Skip to content

Small fixes

Mikhail Mazurskiy requested to merge ash2k/fixes into main

What does this MR do and why?

  • First commit uses a new nested context when calling streaming RPCs to ensure RPC is always aborted. One needs to be careful with streaming RPCs because on e.g. early return (on error) or panic the RPC will not be cleaned up by GC, consuming resources, potentially leading to memory leaks.
  • Seconds commit simplifies file contents retrieval. Current code reads the file into RAM, creates a reader on top of the byte slice, then reads from the reader into a new buffer, turns it into a byte slice. No point in this. The original intent was probably to read the file lazily but not implemented correctly. In practice the builder accumulates all the added files in memory anyway, so no need to make the loading lazy.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Merge request reports

Loading