Track socket already in use

Summary:
Some times the socket can already be in use by an existing process. Track it as to quantify how likely this is found in production. May remove later.

Need to answer:
- Socket already in use rate over time

Reviewed By: antonk52

Differential Revision: D46219768

fbshipit-source-id: 27da82cddb707f729a1d43079e84c221bb544a82
This commit is contained in:
Lorenzo Blasa
2023-05-26 08:02:12 -07:00
committed by Facebook GitHub Bot
parent 694f6f284e
commit 6936cb34ac
2 changed files with 2 additions and 1 deletions

View File

@@ -176,7 +176,7 @@ async function startProxyServer(
console.warn(
`Cannot start flipper-server because socket ${socketPath} is in use.`,
);
// TODO: track socket is in use.
tracker.track('server-socket-already-in-use', {});
} else {
console.info(`Cleaning up stale socket ${socketPath}`);
await fs.rm(socketPath, {force: true});

View File

@@ -15,6 +15,7 @@ type TrackerEvents = {
present: boolean;
error?: string;
};
'server-socket-already-in-use': {};
};
class ServerCoreTracker {