Skip to content

feat: Support connection reset fault injection #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

bflad
Copy link
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.
Copy link

linear bot commented Jul 15, 2025

Copy link

@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
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