-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The request never returns #239
Comments
Where exactly? Until GetPending() the response is not marked as in use so the request will timeout. And after GetPending() I see no code path without Notify. |
What does it mean that the response is not marked as in use? I checked the code and found that when the data is sent out, the response will wait on a condition variable. But if Receive(amsTcpHeader) throws an exception, then GetPending will never be called. Do you mean that if Receive(amsTcpHeader) throws an exception, the condition variable will also time out and be awakened by itself? |
I repeat "Where exactly?". Here we wait with a timeout: ADS/AdsLib/standalone/AmsConnection.cpp Line 25 in 20d4a67
Only after invokeId wasn't consumed by GetPending ADS/AdsLib/standalone/AmsConnection.cpp Line 169 in 20d4a67
The Wait() will return ADS/AdsLib/standalone/AmsConnection.cpp Line 29 in 20d4a67
Only after invokeId was consumed we would wait a second time without timeout ADS/AdsLib/standalone/AmsConnection.cpp Line 33 in 20d4a67
But in these cases GetPending() was successful and we either got an unknown AMS command id ADS/AdsLib/standalone/AmsConnection.cpp Line 350 in 20d4a67
Or we call ReceiveFrame() ADS/AdsLib/standalone/AmsConnection.cpp Line 340 in 20d4a67
ADS/AdsLib/standalone/AmsConnection.cpp Line 345 in 20d4a67
And I see no codepath in ReceiveFrame without a Notify(). |
When a request is sent and a response is waiting, another thread calls the delete route. Then the request will be blocked forever. After analyzing the code, it seems that the Notify of the response will never be called because the Recv method of AmsConnection will throw an exception.
The text was updated successfully, but these errors were encountered: