You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Need timeout support on long-running operations like Db, HTTP calls, etc. timeout middleware supports cancellation with context but has race conditions.
We need a middleware that creates context with timeout and injects ContextWithTimeout to c.Request().Context()
New approach also fixes #2306.
Expected behaviour
We need to introduce a new middleware (middleware.ContextTimeout()) that creates context with timeout and injects ContextWithTimeout to c.Request().Context(). If the handler returns an error that wraps context.DeadlineExceeded, it returns Service Unavailable (503)
Issue Description
Need timeout support on long-running operations like Db, HTTP calls, etc. timeout middleware supports cancellation with context but has race conditions.
We need a middleware that creates context with timeout and injects
ContextWithTimeout
toc.Request().Context()
New approach also fixes #2306.
Expected behaviour
We need to introduce a new middleware (
middleware.ContextTimeout()
) that creates context with timeout and injectsContextWithTimeout
toc.Request().Context()
. If the handler returns an error that wrapscontext.DeadlineExceeded
, it returns Service Unavailable (503)New approach also fixes #2306.
Actual behaviour
With current timeout middleware, since it has a race condition, it is not safe to use in production.
The text was updated successfully, but these errors were encountered: