Closed 2opremio closed 1 week ago
Discovered while investigating failing tests at https://github.com/stellar/soroban-rpc/pull/207
It turns out the goroutines are closed in many places but something must be amiss, since they are still left behind in some cases. All the (*pipe).read
goroutines in this dump are from Closed()
captive core backends (from different soroban-rpc tests):
I think stellarCoreRunner.handleExit()
may not be closing the pipes in some cases
Here's another dump:
It looks like there are a few createCmd calls where we do not close the log line writers:
getLogLineWriter()
creates a pipe and a goroutine, but the goroutine sometimes doesn't exit (and the pipe is never released).Every time captive core is restarted this causes a leak.
The easiest fix is probably returning a
CloseWriter
and making sure that the writer is closed (releasing the pipe and the goroutine).