Skip to content
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

Executing an empty Concurrence container hangs forever #51

Merged
merged 1 commit into from Jun 13, 2023

Conversation

okalachev
Copy link

Let's say one have some code like:

cc = Concurrence(['foo'], default_outcome='foo')

with cc:
    if add_bar:
        Concurrence.add('bar', Bar())
    if add_baz:
        Concurrence.add('baz', Baz())
cc = execute()

If both conditions are negative, the execute method will hang forever. I guess, this is pretty unexpected and confusing behaviour, and may cause strange bugs.

I propose to raise an exception in such situations.

@Timple
Copy link

Timple commented Aug 10, 2020

Or immediately return the default outcome could also be an option.

@130s
Copy link
Member

130s commented Jun 13, 2023

Thank you for contribution.

I have not tested nor thoroughly reviewed but brief look the goal you describe seems achieved.

Merging and will depend on the community to further test.

@130s 130s merged commit 48893f9 into ros:indigo-devel Jun 13, 2023
130s added a commit to 130s/executive_smach that referenced this pull request Jun 13, 2023
Executing an empty Concurrence container hangs forever
@130s 130s mentioned this pull request Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants