Skip to content

feat: Support connection reset fault injection#31

Merged
bflad merged 2 commits intomainfrom
bflad/gen-1674-bug-go-sdk-returns-permanent-retry-error-on-certain
Aug 5, 2025
Merged

feat: Support connection reset fault injection#31
bflad merged 2 commits intomainfrom
bflad/gen-1674-bug-go-sdk-returns-permanent-retry-error-on-certain

Conversation

@bflad
Copy link
Copy Markdown
Member

@bflad bflad commented Jul 15, 2025

This change supports new reset_count fault injection via the fault-settings header, which enables connection error testing such as the x-speakeasy-retries extension retryConnectionErrors configuration. Enabling this injection will immediately close the connection before writing any response (similar to the reject_count injection) and sets SO_LINGER to 0, which on most platforms should cause a TCP RST packet.

This change supports new `connection_close_count` and `connection_reset_count` fault injection via the `fault-settings` header, which enables connection error testing such as the `x-speakeasy-retries` extension `retryConnectionErrors` configuration. Enabling these injection will immediately close the connection before writing any response. The reset handling sets SO_LINGER to 0, which on most platforms should cause a TCP RST packet.
@linear
Copy link
Copy Markdown

linear bot commented Jul 15, 2025

Copy link
Copy Markdown

@2ynn 2ynn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@bflad
Copy link
Copy Markdown
Member Author

bflad commented Aug 5, 2025

Thanks, @2ynn! Reviewing the existing fault middleware, it looks like the reject_count injection already handles the connection close scenario. It doesn't do the reset / no socket linger bit though so I'll rework this to just do that and call it reset_count 👍

@bflad bflad changed the title feat: Support connection close/reset fault injection feat: Support connection reset fault injection Aug 5, 2025
@bflad bflad merged commit 1fa6b6e into main Aug 5, 2025
2 checks passed
@bflad bflad deleted the bflad/gen-1674-bug-go-sdk-returns-permanent-retry-error-on-certain branch August 5, 2025 13:24
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.

2 participants