Recover panics in gRPC handlers
Summary
Add panic recovery interceptors for gRPC handlers to prevent server goroutine crashes. When a panic occurs, the interceptor logs the stack trace and returns codes.Internal to the caller instead of crashing.
Changes
- Add
interceptor.gowith unary and stream panic recovery interceptors - Wire up interceptors via
ErrorOnPanic()function which returnsgrpc.ServerOptionvalues - For both unary and stream handlers: panic is recovered, logged with stack trace, and
codes.Internalis returned - Add
GRPCStatus()method toerrBadJobIDto returncodes.NotFoundinstead of generic error - Comprehensive test coverage for all panic recovery scenarios
References
Relates to #430 (closed)
Edited by Cameron Swords