executors: add 30-second HTTP timeout to webhook executor#12
Open
jaredzwick wants to merge 1 commit into
Open
Conversation
- Build the shared reqwest::Client in process_actions with a 30-second timeout so a hung webhook target cannot stall the executor loop. - Add WebhookError::Timeout variant; map reqwest::Error::is_timeout() to it (distinct from generic Transport) so callers can retry on their own schedule. - Add wiremock test times_out_on_slow_target: 2-second delay vs 1-second client timeout asserts WebhookError::Timeout is returned. - Document default timeout in README Action Executors → Webhook section. Closes HIR-112 Co-Authored-By: Paperclip <noreply@paperclip.ing>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up from HIR-112 / PR #8 review.
process_actionsnow builds the sharedreqwest::Clientwith a 30-second timeout (connection + read combined) viaClient::builder().timeout(Duration::from_secs(30)).build(). A hung webhook target can no longer stall the executor loop indefinitely.WebhookError::Timeoutvariant.reqwest::Error::is_timeout()maps to it rather than the genericTransport, so callers can distinguish timeout retries from unrecoverable transport errors.times_out_on_slow_target: mock responds after 2 s against a 1-second client timeout and assertsWebhookError::Timeoutis returned.Test plan
cargo test --package pypes --lib executors— 17 tests pass, including newtimes_out_on_slow_targetsrc/server/are untouched (out of scope)Files changed
src/executors/webhook.rs—WebhookError::Timeoutvariant,map_transporthelper, new testsrc/executors/mod.rs— client builder with 30s timeoutREADME.md— timeout documentation🤖 Generated with Claude Code