Skip to content

Patch Enumerator#next to get better stack traces

What does this MR do and why?

Enumerator#next has poor stack traces due to https://bugs.ruby-lang.org/issues/16829. Append the caller's stack trace to the raised exception.

Found while working on #342703 (closed). Gitlab::GitalyClient::Call#instrument_stream calls Enumerator#next. which means that exceptions thrown while reading from a GRPC stream (in this case a GRPC::DeadlineExceeded) contain only the backtrace information from GRPC itself, since that's all that's running in the Fiber created by #next

Example stacktrace: !88882 (comment 994128140)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Thong Kuah

Merge request reports

Loading