diff options
| author | Bitflash <btf01@proton.me> | 2026-08-01 13:10:23 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-01 13:10:23 -0300 |
| commit | 21c8bb63cb85f3001ddee9237b1d7e689675d293 (patch) | |
| tree | 9668f6bf39635424a6180c7a7edb6c7931ea7545 /src/net.h | |
| parent | 7131c30c33c980f0ba1d37dfc6a3fbe8c319813e (diff) | |
diag: count sockets by where they were created, and whether the close took (#86)
A node was found holding 1502 sockets in Windows bound state, one ephemeral port
each, 9% of the machine range in nineteen hours. Reading the code did not find
it: every connect() failure path here closes its socket.
So count. Every socket is tagged at creation and untagged at close, across all
ten sites, with a counter for closes that fail. Already rules out three
explanations: nothing is created or closed behind the counter (untagged closes
are zero), no close is failing, and the leaked sockets are not in the live set --
tracked live matches what the OS reports as established, while the bound pile is
something the program already closed successfully.
Diffstat (limited to 'src/net.h')
| -rw-r--r-- | src/net.h | 2 |
1 files changed, 2 insertions, 0 deletions
| @@ -121,6 +121,8 @@ extern int64 nBlocksWithoutParent; // ...of those, how many arrived orphaned | |||
| 121 | // user pastes into an issue is what a developer already knows how to read. | 121 | // user pastes into an issue is what a developer already knows how to read. |
| 122 | string GetDiagnosticsText(); | 122 | string GetDiagnosticsText(); |
| 123 | 123 | ||
| 124 | #include "sockcount.h" | ||
| 125 | |||
| 124 | // Defined in main.cpp. Declared here because CNode announces it in the version | 126 | // Defined in main.cpp. Declared here because CNode announces it in the version |
| 125 | // message, and net.h is included before main.h. | 127 | // message, and net.h is included before main.h. |
| 126 | extern int nBestHeight; | 128 | extern int nBestHeight; |