gunli opened a new issue, #10670: URL: https://github.com/apache/inlong/issues/10670
### What happened Let's review the code: In the callback of conn.AsyncWrite() we may call worker.updateConn(), updateConn() may try to open new conn in some case, if so, it will call gnet.Client.Dial(), but gnet.Client.Dial() will be blocked unitl gnet event loop mark the conn is opened, but now the event loop is running in conn.AsyncWrite()'s callback: conn.AsyncWrite()'s callback-->worker.updateConn()-->gnet.Client.Dial()-->waiting for conn.AsyncWrite()'s callback to return. ### What you expected to happen Do not block the SDK even if we update the conn in conn.AsyncWrite()'s callback. ### How to reproduce 1. Use the Golang SDK connect to a cluster data proxy and report messages; 2. Stop or kill one of the data proxy; 3. Some SDK may block when they attend to open new connections. Or, review the code. In the callback of conn.AsyncWrite() we may call worker.updateConn(), updateConn() may try to open new conn in some case, if so, it will call gnet.Client.Dial(), but gnet.Client.Dial() will be blocked unitl gnet event loop mark the conn is opened, but now the event loop is running in conn.AsyncWrite()'s callback: conn.AsyncWrite()'s callback-->worker.updateConn()-->gnet.Client.Dial()-->waiting for conn.AsyncWrite()'s callback to return. ### Environment _No response_ ### InLong version master ### InLong Component InLong SDK ### Are you willing to submit PR? - [X] Yes, I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
