-
Notifications
You must be signed in to change notification settings - Fork 181
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
hotfix/memfile-ack-logic-deadlock #1795
Conversation
… to "deadlock" in case of very long ack timeout setting
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.
clang-tidy made some suggestions
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ptions from this process
void CDataWriterSHM::RemoveSubscription(const std::string& host_name_, const int32_t process_id_, const std::string& topic_id_) | ||
{ | ||
// we accept local disconnections only | ||
if (host_name_ != m_attributes.host_name) return; |
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.
I am not sure that this is correct. If we communicate through docker images, we might have different host_name, but identical host_group.
Anyways, who applies the RemoveSubscription?
If you remove only subscriptions from IDs which have previously been subscribed, you don't need to do any checks here.
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.
This seems to be a general issue, and will be adressed with #1804
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.
👍
Description
If the shm data transport layer acknowledgment feature is used and the ack time is set to a large value the publisher send may wait for a this long time on the ack event from the subscriber even the subscriber is no more existing (process is terminated for example). The SHM Datawriter Connect/Disconnect API is locked as long the Datawriter is waiting for the ack signal. That leads to a lock of the Registration layer finally.
Solution:
RemoveSubscription
toCDataWriterSHM
to react on un-registrations from the registration layer in generalConnect/Disconnect
functionality ofCSyncMemoryFile
fromSyncContent()
to be able to modify the map of the memfile connection events evenSyncContent()
is waiting on a sync event.