-
Notifications
You must be signed in to change notification settings - Fork 3
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
[EK-30] Fix TOCTTOU race in SingleGoalMultipleActionServers
implementation
#78
[EK-30] Fix TOCTTOU race in SingleGoalMultipleActionServers
implementation
#78
Conversation
Signed-off-by: Michel Hidalgo <[email protected]>
Signed-off-by: Michel Hidalgo <[email protected]>
func: typing.Optional[typing.Callable] = None, | ||
lock: typing.Optional[threading.Lock] = None, | ||
) -> typing.Callable: | ||
"""Wraps `func` to synchronize invocations, optionally taking a user defined `lock`.""" |
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.
Can you add to the docstring the use case for func
being None
?
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.
Sure thing. Done in a924c85
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.
Approved on the condition that the docstring is updated
Signed-off-by: Michel Hidalgo <[email protected]>
Signed-off-by: Michel Hidalgo <[email protected]>
Argh, there was a race in the tests. It is fixed now. PTAL ! |
Signed-off-by: Michel Hidalgo <[email protected]>
@@ -22,25 +23,31 @@ def __init__( | |||
self, | |||
node: Node, | |||
action_server_parameters: List[Tuple[ActionType, str, Callable, Optional[CallbackGroup]]], | |||
nosync: bool = False, | |||
) -> None: | |||
"""Constructor""" |
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.
Can you update the docstring with when you would want to set nosync
to True
?
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.
Done in 224a408.
Signed-off-by: Michel Hidalgo <[email protected]>
Precisely what the title says. This patch prevents race conditions when enforcing multiple actions managed by a single
SingleGoalMultipleActionServers
instance are mutually exclusive. It also migrates to cancellation rather than abortion for goal preemption.