[Metrics] Add metadata polling for detecting preemption - #5394
Open
PauloVLB wants to merge 1 commit into
Open
Conversation
PauloVLB
force-pushed
the
preemption-polling
branch
from
July 28, 2026 19:58
1669c0c to
3a0bb49
Compare
PauloVLB
marked this pull request as ready for review
July 28, 2026 21:36
PauloVLB
force-pushed
the
preemption-polling
branch
from
July 29, 2026 13:26
3a0bb49 to
e9298b0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
b/538558303
Problem
Preemptible VMs often get shut down by GCP before they can finish a fuzzing batch and report their metrics. Because the standard OS signals (
SIGTERM) are often swallowed by the nested process hierarchy (PID 1 barriers in containers), the bot dies silently, leading to lost fuzzing hours and inaccurate metrics.Proposed Solution
Instead of relying solely on OS signals, we now poll the GCP Metadata server for preemption events directly from a background thread. This bypasses the signal propagation barrier.
_PreemptionPollerinmonitor.pyto check theinstance/preemptedmetadata key every 15 seconds (only on Preemptible VMs).compute_metadata.pyviaget_preempted_status().threading.Lockto_TrackFuzzTimeinfuzz_task.pyto ensure thread safety when reading/writing active trackers concurrently from the main thread and the poller thread.Validation
Validated in dev environment. Preemption events are now successfully detected.
Preemption being detected by polling metadata logs