-
Notifications
You must be signed in to change notification settings - Fork 46
RSDK-10618: Fix race contition in managedProcess #432
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
Conversation
@dgottlieb I'm still testing things on the rdk side but I think this PR can be looked at now. The most important update from when we last went over these changes is |
This all looks great to me. Very nice job |
For security reasons, this PR must be labeled with |
This PR fixes an issue where a race could occur between calls to
managedProcess.Stop
and parts ofmanagedProcess.manage
if the process crashed just before the call toStop
. This will have a matching change on the rdk side (viamrobotics/rdk#4975) where the race caused duplicate module processes to be created during reconfiguration.One thing worth noting: this change has the potential to create a deadlock if calling code tries to hold the same lock goroutines calling
Stop
and in their restart callback. This was an issue I fixed in my rdk modmanager changes but there may be other places this code is used that need to be audited for potential deadlocks.