BaseSocket async_write buffer lifecycle [API-1814] [API-1808] [API-1807]#1104
Merged
OzanCansel merged 7 commits intohazelcast:masterfrom Feb 23, 2023
Merged
BaseSocket async_write buffer lifecycle [API-1814] [API-1808] [API-1807]#1104OzanCansel merged 7 commits intohazelcast:masterfrom
OzanCansel merged 7 commits intohazelcast:masterfrom
Conversation
Contributor
|
Windows test PASSed. |
Contributor
|
Linux test PASSed. |
OzanCansel
suggested changes
Feb 22, 2023
Contributor
OzanCansel
left a comment
There was a problem hiding this comment.
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
Contributor
|
Windows test PASSed. |
Contributor
|
Linux test PASSed. |
OzanCansel
previously approved these changes
Feb 23, 2023
Contributor
|
Windows test PASSed. |
Contributor
|
Linux test PASSed. |
Contributor
|
Linux test FAILed. |
OzanCansel
approved these changes
Feb 23, 2023
Contributor
|
Windows test PASSed. |
Contributor
|
Linux test PASSed. |
ihsandemir
reviewed
Feb 23, 2023
Contributor
|
Linux test PASSed. |
Contributor
|
Windows test FAILed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: