Skip to content

fix(appsec): make shutdown and response waits cancellation-safe - #4851

Open
Aur3ns wants to merge 1 commit into
crowdsecurity:masterfrom
Aur3ns:fix/appsec-reload-deadlock-4739
Open

Aur3ns wants to merge 1 commit into
crowdsecurity:masterfrom
Aur3ns:fix/appsec-reload-deadlock-4739

Conversation

@Aur3ns

@Aur3ns Aur3ns commented Nov 23, 2026 •

Copy link
Copy Markdown

Fixes #4739.

During reload, AppSec handlers can remain blocked on dispatch or response after the runners stop, preventing HTTP shutdown from completing.

  • Cancel pending request waits on shutdown or client disconnect.
  • Buffer runner replies to prevent blocked sends.
  • Bound graceful HTTP shutdown to 5 seconds, with forced close as a fallback.

Testing

The diff has been personally reviewed. Testing was performed using automated CI with AI-assisted tooling.

Related to #4642, which addresses a separate listener startup issue.

/kind fix
/area appsec

Signed-off-by: Aur3ns <141164867+Aur3ns@users.noreply.github.com>
@Aur3ns
Aur3ns force-pushed the fix/appsec-reload-deadlock-4739 branch from e67fbc3 to 9e7aabf Compare December 3, 2026 15:42

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AppSec: SIGHUP reload deadlocks in shutdown — handlers block on InChan after runners exit, server.Shutdown waits forever

1 participant