Skip to content
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

Feature Request: Echo server socket close during client request #873

Open
llu94 opened this issue Dec 13, 2023 · 5 comments
Open

Feature Request: Echo server socket close during client request #873

llu94 opened this issue Dec 13, 2023 · 5 comments

Comments

@llu94
Copy link

llu94 commented Dec 13, 2023

My team would like to add a new feature to the /echo endpoint where we can close the socket during not after the request is processed.

Currently the close parameter allows us only to close the socket after the response is sent not during request processing.

close | close the socket after answering e.g close=true to close after all requests or close=5.3 to close after approximately 5.3% of requests

@ldemailly
Copy link
Member

Just to be sure: you mean you want an option to just error out/close the connection without even an HTTP code reply? but as a percentage? there is a "closing server" already used for some test but that one is not conditional

We could indeed add a close-before - the thing though is that the incoming request has to be parsed to figure that out, so that may not simulate what you're actually after? (if you wanted to close before even reading anything)

@llu94
Copy link
Author

llu94 commented Dec 14, 2023

@ldemailly the use case we'd like to simulate is no response being sent. We're okay if the request is parsed but we'd like for the socket to close before the response is sent out.

@llu94
Copy link
Author

llu94 commented Dec 14, 2023

@ldemailly I'm game to add a close-before option if you have any guidelines or requests or ideas on how to implement it.

@ldemailly
Copy link
Member

I'm game to add a close-before option if you have any guidelines or requests or ideas on how to implement it.

Sure, thanks. question is whether it's a variant on close= maybe it could be

close=true 
close=5.3

remains the current behavior
and then

close=first
close=-5.3

for close first 100% or 5.3% respectively

or a new option entirely that can be composed so you'd close after in some % and close before in some other %

not sure... what's the best api vs complexity/too man flags and options

@llu94
Copy link
Author

llu94 commented Dec 15, 2023

AIUI /echo only has like 5 flags rn; I think we should add a new feature flag. We could call it break or something. I can put in a PR with a tentative name and we can slowly discuss a name for the API.

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

No branches or pull requests

2 participants