Skip to content

Conversation

@Fluder-Paradyne
Copy link

Hey, I’ll be honest — I used AI to create this PR.
I’m still trying to understand what’s happening, but this PR might help with root causing or solving #45, and it might also fix my issue #81.

…inish/timeout; restore fast-path BufferPool; tests pass with -race
@Fluder-Paradyne
Copy link
Author

it is passing all the tests, except Bearer PR Check for using unsafe.
pr in my forked repo : Fluder-Paradyne#6

…anicking

Reason: re-panicking in non-debug mode depended on Gin's recovery defer still being in scope. Under certain timings (goroutine scheduling, recovery frame unwinding), the re-panic escaped recovery and intermittently failed tests (e.g., TestTimeoutPanic with high -count). We now always handle the panic inside the timeout middleware by writing a 500 with 'panic caught: <value>' and only include the stack trace when gin.IsDebugging(). This removes timing-dependent behavior, avoids double-recovery, and keeps the rest of the middleware semantics intact (chain continues on copied context, main goroutine flushes/aborts). Result: deterministic behavior and passing tests under -race and high iteration counts.
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.

1 participant