mononoke: edenapi: Add a comment to prevent a memory leak from being reintroduced

Summary:
There was a memory leak in EdenAPI server caused by cloning `rctx` and
passing it into the error logging task. D26451527 (de46828572) fixed the memory leak.

Add a comment to warn others so that the memory leak isn't reintroduced.

Reviewed By: farnz

Differential Revision: D26459153

fbshipit-source-id: e6b5a97e511144f93dfdd29caa6f4c92d54be957
This commit is contained in:
Harvey Hunt 2021-02-16 04:25:02 -08:00 committed by Facebook GitHub Bot
parent bbf475a1e7
commit 315fb0613b

View File

@ -45,6 +45,9 @@ impl RequestContext {
};
// Spawn error logging task.
//
// NOTE: Make sure that rctx isn't cloned and then moved into this task as it will lead to
// a memory leak due to error_rx never returning None. See D26451527 for more information.
let _ = tokio::spawn({
cloned!(rctx.logger);
async move {