Affects all three feed parsers: topofbook-parser, marketbyorder-parser, marketbyprice-parser.
Raised by @juan-malbeclabs in review of #29 (thread). Deliberately not fixed there, because fixing it in one module alone would fork the shutdown semantics from the other two.
Problem
Runner.Run spawns one goroutine per port and blocks on wg.Wait(). In receive, a non-timeout read error sends to errs and returns — exiting only that goroutine. The other two keep looping until the context is cancelled, so wg.Wait() never returns and Run never surfaces the error.
The process then stays up serving 2 of 3 ports indefinitely, with only a metric to show it. For marketbyprice-parser that means, for example, losing snapshot while mktdata keeps flowing, so a consumer can never resynchronize a gap instrument but sees no failure.
Fix
Cancel a shared context on the first fatal read error so the sibling goroutines wind down and Run returns the error to the caller, which already knows how to exit non-zero.
Should land as one change across all three parsers to keep their lifecycle behavior identical.
Affects all three feed parsers:
topofbook-parser,marketbyorder-parser,marketbyprice-parser.Raised by @juan-malbeclabs in review of #29 (thread). Deliberately not fixed there, because fixing it in one module alone would fork the shutdown semantics from the other two.
Problem
Runner.Runspawns one goroutine per port and blocks onwg.Wait(). Inreceive, a non-timeout read error sends toerrsand returns — exiting only that goroutine. The other two keep looping until the context is cancelled, sowg.Wait()never returns andRunnever surfaces the error.The process then stays up serving 2 of 3 ports indefinitely, with only a metric to show it. For
marketbyprice-parserthat means, for example, losingsnapshotwhilemktdatakeeps flowing, so a consumer can never resynchronize agapinstrument but sees no failure.Fix
Cancel a shared context on the first fatal read error so the sibling goroutines wind down and
Runreturns the error to the caller, which already knows how to exit non-zero.Should land as one change across all three parsers to keep their lifecycle behavior identical.