Closed fabled closed 1 year ago
Hi @fabled,
I can't reproduce it so I've blindly approached it based on theoretical analysis. Please, test.
I can reproduce it easily, and will test Monday. But looking at the commit, I think it should work just fine.
Hi @fabled,
Can I close this issue as resolved?
Thank you!
I got the following debug output:
After which things just hang.
What apparently happens is:
Thread A: executes func (conn usbConn) put() Thread B: func (transport UsbTransport) Shutdown(ctx context.Context) error Thread A: logs "connection released, 0 in use" Thread B: transport.connInUse returns 1 Thread A: returns connection to pool + async signals the channel Thread B: starts listening signal and missed it
As an immediate workaround I just added Shutdown to execute the polling for loop every 500ms if no channel message is received. Which is ugly and does not fix the root cause, but workarounds the symptoms.