You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Use the Golang SDK connect to a cluster data proxy and report messages;
Stop or kill one of the data proxy;
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.
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
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?
Code of Conduct
The text was updated successfully, but these errors were encountered: