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

feat: support idle timeout for HTTP requests #339

Merged
merged 6 commits into from
May 14, 2024

Conversation

nyannyacha
Copy link
Collaborator

@nyannyacha nyannyacha commented May 12, 2024

What kind of change does this PR introduce?

Feature

Description

Note: This PR is behind PR-337. (PR will be rebased after PR-337 has been merged into main)

This PR introduces the feature for a user worker to force a response to complete (timeout) if it does not complete the response within a specified amount of time after receiving the request from the pooler.

List of arguments to be created due to the introduction of this PR

  • --request-idle-timeout flag specifies maximum time in milliseconds that can be waited from when a worker takes over the request. (disabled by default)

Timeout behaviors by response types

Response Type Behavior
Content-Length present (ie. not stream response) Respond with HTTP 408 Request Timeout
No Content-Length present (ie. stream response) Emit an EOF to a stream immediately
Upgraded Connection (ie. WebSocket) Connection Reset

Note: Timeout behavior for upgraded connections seems like something that needs to be improved in the future

@nyannyacha nyannyacha force-pushed the fix-worker-req-idle-timeout branch 2 times, most recently from fd535ce to e45865a Compare May 13, 2024 21:06
@nyannyacha nyannyacha marked this pull request as ready for review May 13, 2024 22:13
@nyannyacha nyannyacha force-pushed the fix-worker-req-idle-timeout branch from e45865a to 3967d2d Compare May 13, 2024 23:29
@nyannyacha nyannyacha requested a review from laktek May 13, 2024 23:35
@nyannyacha nyannyacha merged commit 196d41d into supabase:main May 14, 2024
3 checks passed
@nyannyacha nyannyacha deleted the fix-worker-req-idle-timeout branch May 14, 2024 01:14
Copy link

🎉 This PR is included in version 1.51.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants