Skip to content

fix(audit): handle Redis read timeouts - #3

Merged
man4ish merged 1 commit into
mainfrom
fix/worker-read-timeout
Aug 9, 2026
Merged

fix(audit): handle Redis read timeouts#3
man4ish merged 1 commit into
mainfrom
fix/worker-read-timeout

Conversation

@man4ish

@man4ish man4ish commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Fix Redis read timeout crash loop

Problem

The security-audit worker could terminate when the blocking Redis
XREADGROUP operation reached the redis-py socket read timeout while the
stream was idle.

Docker would restart the worker, causing a recurring crash loop approximately
every five seconds.

Fix

Handle the expected Redis read timeout at the worker's outer blocking-read
boundary so an idle stream does not terminate the worker process.

Unexpected exceptions remain distinguishable and are not silently swallowed.

Regression coverage

Tests verify:

  • read timeout does not terminate the worker
  • the read loop continues
  • messages are still processed after a timeout
  • existing ACK behavior remains intact
  • unexpected exceptions retain their existing behavior
  • clean shutdown remains functional

Validation

  • focused worker tests: 12 passed
  • full test suite: 179 passed
  • runtime idle-worker validation: PASS (stable across 6 x 5s idle read cycles, 0 restarts)
  • subsequent event processing: PASS (new event consumed and persisted, 0 duplicates)
  • no crash loop observed
  • git diff --check: PASS

Scope

This PR only fixes the worker's Redis read-timeout handling.

No Interaction implementation is included.
No API Gateway changes are included.
No Control Center changes are included.
No authentication/session changes are included.

@man4ish
man4ish merged commit a629387 into main Aug 9, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant