Skip to content

Commit b186428

Browse files
committed
Add new setting to diagnostics mode. Minor cleanup.
1 parent 291ea79 commit b186428

4 files changed

Lines changed: 12 additions & 6 deletions

File tree

serve_event_listener/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ def _print_diagnostics(args) -> None:
125125
"NXDOMAIN_CONFIRMATION_COUNT": getattr(
126126
sq, "NXDOMAIN_CONFIRMATION_COUNT", "<n/a>"
127127
),
128+
"ROLLOUT_GUARD_SECONDS": getattr(sq, "ROLLOUT_GUARD_SECONDS", "<n/a>"),
128129
}
129130
except Exception:
130131
probe_cfg = {
@@ -135,6 +136,7 @@ def _print_diagnostics(args) -> None:
135136
"DELETED_PROBE_WINDOW": "<unavailable>",
136137
"DELETED_PROBE_INTERVAL": "<unavailable>",
137138
"NXDOMAIN_CONFIRMATION_COUNT": "<unavailable>",
139+
"ROLLOUT_GUARD_SECONDS": "<unavailable>",
138140
}
139141

140142
logger.info("\n===== diagnostics =====")

serve_event_listener/probing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def probe_url(self, port80_url: str, headers: dict | None = None) -> ProbeResult
5959
"""Probe a single HTTP URL and classify availability."""
6060
# NotFound — DNS cannot resolve
6161
if not self._dns_resolves(port80_url):
62-
logger.info(
62+
logger.debug(
6363
"Skipping URL probing because DNS resolution failed for url %s",
6464
port80_url,
6565
)

serve_event_listener/status_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def update(self, event: dict) -> None:
335335
# As we are not ready to introduce a new status Terminating, we will only log it for now
336336
is_terminating = is_pod_terminating(pod)
337337
logger.info(
338-
"Is release %s identified as Termianting? %s", release, is_terminating
338+
"Is release %s identified as Terminating? %s", release, is_terminating
339339
)
340340

341341
status_object = pod.status

serve_event_listener/status_queue.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def process(self) -> None:
164164
self._rollout_block_until = {} # release -> epoch (float)
165165

166166
PERIOD = PROCESS_TICK_SECONDS
167-
guard_seconds = globals().get("ROLLOUT_GUARD_SECONDS", 15.0)
167+
guard_seconds = globals().get("ROLLOUT_GUARD_SECONDS", 30.0)
168168

169169
next_tick = time.monotonic()
170170
while not self.stop_event.is_set():
@@ -199,6 +199,10 @@ def process(self) -> None:
199199
block_until = self._rollout_block_until.get(release)
200200
if block_until and now < block_until:
201201
# inside guard: defer; optionally probe to see if it flipped back to Running
202+
logger.debug(
203+
"Release %s guarded by rollout block, rejecting preliminary status deleted",
204+
release,
205+
)
202206
if (
203207
self.prober
204208
and self._probe_enabled_for(rec)
@@ -231,11 +235,11 @@ def process(self) -> None:
231235
# (no-op here, because we're still inside guard)
232236
continue
233237
else:
234-
# guard expired clean out any stale entry
238+
# guard expired, clean out any stale entry
235239
if block_until and now >= block_until:
236240
self._rollout_block_until.pop(release, None)
237241

238-
# probing path (gated)
242+
# ---- Probing path ----
239243
if status_lc in {"running", "deleted"} and self._probe_enabled_for(rec):
240244

241245
logger.info(
@@ -245,7 +249,7 @@ def process(self) -> None:
245249
)
246250

247251
deadline_epoch = self._ensure_deadline(rec, status_lc)
248-
if deadline_epoch is not None and time.time() < deadline_epoch:
252+
if deadline_epoch is not None and now < deadline_epoch:
249253
# still inside the probe window
250254
if self._allow_probe_now(rec):
251255
# try a probe attempt

0 commit comments

Comments
 (0)