Index: cloud_sync.py =================================================================== diff -u -rdebe1b458743b43a0d523b2b30d79fb1b00c336f -r79dadd7422855193f345beced530c6b92fc49b3a --- cloud_sync.py (.../cloud_sync.py) (revision debe1b458743b43a0d523b2b30d79fb1b00c336f) +++ cloud_sync.py (.../cloud_sync.py) (revision 79dadd7422855193f345beced530c6b92fc49b3a) @@ -25,7 +25,7 @@ import threading -VERSION = "0.5.5" +VERSION = "0.5.6" arguments = sys.argv @@ -91,15 +91,15 @@ g_utils.logger.info(SETUP_CONSOLE_LINE) sys.exit(0) -# F7 - fleet-stagger jitter computed once at boot from the HD serial. +# Fleet-stagger jitter computed once at boot from the HD serial. # Reused by ReachabilityProvider (first-probe delay) and FileOutputBus -# (F6 pre-warm window offset). A pre-registration device with no serial +# (pre-warm window offset). A pre-registration device with no serial # gets jitter=0, which is acceptable: registration happens once per # device and is not a fleet-wide concern. _device_serial = g_config[CONFIG_DEVICE].get(CONFIG_DEVICE_HD_SERIAL) _device_jitter_s = get_device_jitter_seconds(_device_serial) g_utils.logger.info( - "F7 fleet jitter: %ds (serial=%s)", _device_jitter_s, _device_serial) + "Fleet-stagger jitter: %ds (serial=%s)", _device_jitter_s, _device_serial) try: reachability_provider = ReachabilityProvider( @@ -116,15 +116,15 @@ try: g_utils.add_reachability_provider(reachability_provider=reachability_provider) - # F6/F7 - pre-warm thread runs inside FileOutputBus; jitter staggers + # Pre-warm thread runs inside FileOutputBus; jitter staggers # the fleet across a 2-minute window starting at 23:55 UTC. output_channel = FileOutputBus(logger=app.logger, max_size=100, file_channels_path=UI2CS_FILE_CHANNELS_PATH, jitter_seconds=_device_jitter_s) error_handler = ErrorHandler(logger=app.logger, max_size=100, output_channel=output_channel) - # F9 — split-lane architecture. + # Split-lane architecture. # State lane (max_size=1): strict-ordering handler for registration, # SET_DEVICE_STATE and SEND_TREATMENT_REPORT. The single-slot queue is # the explicit ordering invariant — do NOT change max_size on this one. @@ -147,16 +147,16 @@ input_channel_name="inp.buf", g_config=g_config, message_handler=message_handler) - # F5 — heartbeat gets the idempotent lane + g_config so it can drain + # Heartbeat gets the idempotent lane + g_config so it can drain # rotated CS-log files one-per-tick when that lane is idle. Registration - # mode sets send_heartbeat=False below, so the F5 branch stays inert - # during registration. + # mode sets send_heartbeat=False below, so opportunistic CS-log upload + # stays inert during registration. heartbeat_provider = HeartBeatProvider(logger=app.logger, network_request_handler=network_request_handler, output_channel=output_channel, idempotent_network_request_handler=idempotent_network_request_handler, g_config=g_config) - # F9 — CS-log uploads (SEND_CS_LOG) go through the idempotent lane. + # CS-log uploads (SEND_CS_LOG) go through the idempotent lane. logconf.set_network_provider(network_request_handler=idempotent_network_request_handler) logconf.set_error_provider(error_handler=error_handler) logconf.set_configuration(g_config=g_config) @@ -177,11 +177,11 @@ # the registration-to-operation transition. watchdog = Watchdog(logger=app.logger) if g_config[CONFIG_DEVICE][CONFIG_DEVICE_MODE] == 'operation': - # F3: scheduler-independent CS-alive file. Auto-starts on construction. - # The `last_progress_ts` attribute is consumed by F1 (below). + # Scheduler-independent liveness file. Auto-starts on construction. + # The ``last_progress_ts`` attribute is consumed by the watchdog (below). alive_provider = AliveProvider(logger=app.logger) - # F1 — progress-signal contracts (plan §4 F1). max_idle_s values - # are conservative; require 3 consecutive stale reads (default + # Per-thread progress-signal contracts. max_idle_s values are + # conservative; require 3 consecutive stale reads (default # max_restarts) before escalating to sentinel, which gives each # thread an effective 3 × check_interval grace on top of max_idle_s. watchdog.register("alive", lambda: alive_provider.thread, @@ -200,8 +200,8 @@ make_restart_fn(network_request_handler, "thread", network_request_handler.scheduler), progress_fn=lambda: network_request_handler.last_progress_ts, max_idle_s=300) - # F9/F1 — idempotent lane worker: large-file uploads legitimately - # take 10–30 min, so max_idle_s is 1800 s (30 min) per plan §4 F1. + # Idempotent lane worker: large-file uploads legitimately take + # 10–30 min, so max_idle_s is 1800 s (30 min). watchdog.register("idempotent_request_handler", lambda: idempotent_network_request_handler.thread, make_restart_fn(idempotent_network_request_handler, "thread", @@ -220,8 +220,8 @@ make_restart_fn(heartbeat_provider, "thread", heartbeat_provider.heartbeat), progress_fn=lambda: heartbeat_provider.last_progress_ts, max_idle_s=90) - # F1 — chronic queue-saturation escalation. If the F4 counter shows - # more than 3 "queue full" events in the last 5 min, individual + # Chronic queue-saturation escalation. If the queue-full counter + # shows more than 3 "queue full" events in the last 5 min, individual # threads are alive but the pipeline is starved — skip restarts and # go straight to sentinel for a clean-slate process restart. watchdog.register_sentinel_condition( @@ -305,8 +305,8 @@ return {"invalidAttributes": invalid_params}, BAD_REQUEST try: - # F4 caller audit: manufacturing-tool credentials flow. Surface - # queue failures to the existing CS2UI_ERROR channel so the MFT + # Manufacturing-tool credentials flow. Surface queue + # failures to the existing CS2UI_ERROR channel so the MFT # can observe and retry. outcome, detail = helpers_add_to_network_queue( network_request_handler=network_request_handler,