-
Notifications
You must be signed in to change notification settings - Fork 46
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
BaseSocket async_write buffer lifecycle [API-1814] [API-1808] [API-1807] #1104
Conversation
Windows test PASSed. |
Linux test PASSed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a general comment, could you run git-clang-format master
to format ?
hazelcast/include/hazelcast/client/internal/socket/BaseSocket.h
Outdated
Show resolved
Hide resolved
hazelcast/include/hazelcast/client/internal/socket/BaseSocket.h
Outdated
Show resolved
Hide resolved
hazelcast/include/hazelcast/client/internal/socket/BaseSocket.h
Outdated
Show resolved
Hide resolved
hazelcast/include/hazelcast/client/internal/socket/BaseSocket.h
Outdated
Show resolved
Hide resolved
hazelcast/include/hazelcast/client/internal/socket/BaseSocket.h
Outdated
Show resolved
Hide resolved
hazelcast/include/hazelcast/client/internal/socket/BaseSocket.h
Outdated
Show resolved
Hide resolved
Windows test PASSed. |
Linux test PASSed. |
Windows test PASSed. |
Linux test PASSed. |
Linux test FAILed. |
Windows test PASSed. |
Linux test PASSed. |
Linux test PASSed. |
Windows test FAILed. |
It seems that there is a problem with the lifecycle of invocations. When async_write method of the boost library is called, user should guarantee the validity of the buffer until the write operation complete. The invocations are added to an unordered_map with add_invocation_to_map method and erased when the response of the message is received or connection is closed. The problem occurs when the invocation is deleted as the response is received, and after that the write handler completion occurs. As the buffer is already deleted, boost async_write completion runs with deleted buffers and error occurs. We think that this case occurs when an async_write occurs while there is already a message in outbox.
A Sample scenario: