Skip to content

fix(http): make response callbacks exception-safe - #40

Merged
LimiNode merged 2 commits into
mainfrom
fix/http-callback-exception-safety
Sep 21, 2026
Merged

LimiNode merged 2 commits into
mainfrom
fix/http-callback-exception-safety

Conversation

@LimiNode

Copy link
Copy Markdown
Owner

Summary

  • centralize intermediate and final HTTP response callback invocation in HttpRequestContext
  • always run terminal completion after a throwing user callback
  • isolate rate-limit and group completion callbacks so one exception cannot skip the other
  • route callback failures through the existing NetworkWorker error path
  • cover throwing callbacks, continued processing, idempotent cleanup, and waiter registration after shutdown

Verification

  • full local integration suite: 13/13 passed
  • http_client_wait_requests_test: passed five additional repeated runs
  • full_cpp11_smoke: built successfully
  • simple_http_request_example: built successfully
  • git diff --check: passed

Centralize HTTP response callback invocation so terminal cleanup always runs, isolate completion callbacks from each other, and cover callback failures and post-shutdown waiter registration.\n\nConstraint: Preserve C++11 compatibility and final-callback-before-group-idle ordering.\nRejected: Duplicating try/catch completion guards across terminal paths.\nDirective: Route new terminal HTTP response paths through invoke_final_callback().\nConfidence: high\nScope-risk: moderate
Use the centralized callback boundary for streaming response chunks and narrow the concurrency documentation to HTTP response and completion callbacks.\n\nConstraint: Preserve streaming callback timing and C++11 compatibility.\nRejected: Keep a second streaming-only exception path with different non-std exception handling.\nConfidence: high\nScope-risk: narrow
@LimiNode
LimiNode merged commit 6424d95 into main Sep 21, 2026
13 of 14 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