Skip to content

fix(webhooks): isolate half-open probe state per consumer URL#550

Merged
Jagadeeshftw merged 2 commits into
Fluxora-Org:mainfrom
Olasunkanmi975:fix/breaker-probe-isolation
Jun 29, 2026
Merged

fix(webhooks): isolate half-open probe state per consumer URL#550
Jagadeeshftw merged 2 commits into
Fluxora-Org:mainfrom
Olasunkanmi975:fix/breaker-probe-isolation

Conversation

@Olasunkanmi975

Copy link
Copy Markdown
Contributor

##closed #510

Summary

Fixes the in-memory webhook circuit breaker to enforce exactly one half-open probe per consumer URL, matching the Redis implementation and preventing probe interference across endpoints.

Changes

  • Isolated half-open probe tracking on a per-URL basis.
  • Ensured probe admission is atomic and limited to one in-flight probe per consumer URL.
  • Reset probe state correctly after successful and failed probe attempts.
  • Added TSDoc documenting the half-open probe semantics and invariants.
  • Added concurrency tests verifying per-URL isolation and parity with the Redis implementation.

Testing

Covered:

  • Concurrent probes for multiple URLs.
  • Exactly one probe admitted per URL.
  • Repeated probes for the same URL.
  • Probe state reset after success.
  • Probe state reset after failure.
  • In-memory behavior matches Redis semantics.

Validation

npm test

Security

This change preserves the exactly-one-probe invariant, preventing a flapping endpoint from affecting probe admission for other consumer URLs.

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Olasunkanmi975 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Olasunkanmi975

Copy link
Copy Markdown
Contributor Author

Hi maintainer, please review my work for Approval

@Olasunkanmi975

Copy link
Copy Markdown
Contributor Author

@Jagadeeshftw hi maintainer please review my pr

@Jagadeeshftw Jagadeeshftw merged commit cf51de6 into Fluxora-Org:main Jun 29, 2026
@Jagadeeshftw

Copy link
Copy Markdown
Contributor

good fix - the in-memory breaker was tracking half-open probe state globally rather than per url, so a probe for one consumer endpoint could block admission for a completely different url. now probe tracking is isolated per consumer url to match the redis implementation. the concurrency tests covering per-url isolation and the parity checks with redis semantics are exactly what this kind of shared-state bug needs.

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.

Isolate half-open probe state per consumer URL in InMemoryWebhookCircuitBreakerStore in src/redis/webhookCircuitBreakerStore.ts

3 participants