Skip to content

Work around Ruby 2.7 garbage collection bugs in Gitaly client

Stan Hu requested to merge sh-workaround-ruby-2.7-gc-bug into master

What does this MR do and why?

As we saw with !81948 (merged), calling Enumerable#flat_map may lead to a GC bug because the concatenated array can be GC'd prematurely. By calling #to_a explicitly, we insert it into the Ruby stack so that GC can recognize it and keep it around.

Relates to #386556 (closed)

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 Stan Hu

Merge request reports