Skip to content

Fix iteration over modified list#1129

Merged
clalancette merged 2 commits intoros2:rollingfrom
felixdivo:fix-iteration-executor
Jun 5, 2023
Merged

Fix iteration over modified list#1129
clalancette merged 2 commits intoros2:rollingfrom
felixdivo:fix-iteration-executor

Conversation

@felixdivo
Copy link
Copy Markdown
Contributor

@felixdivo felixdivo commented May 21, 2023

See the referenced StackOverflow article for why this change is necessary.

It is possible to actually trigger this fault.

Possibly related to #1079.

Copy link
Copy Markdown
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@felixdivo thanks for the PR.

Do you happen to know how https://github.com/felixdivo/ros2-easy-test/actions/runs/5035009110/jobs/9030212775#step:9:116 can happen in theory? i could not figure this out how even this happens...

@felixdivo
Copy link
Copy Markdown
Contributor Author

felixdivo commented May 23, 2023

Do you happen to know how https://github.com/felixdivo/ros2-easy-test/actions/runs/5035009110/jobs/9030212775#step:9:116 can happen in theory? i could not figure this out how even this happens...

I guess in my case it could be a race condition, since I access the executor from different threads, where I think it makes sense that it can occur. I accidentially found #1079, so maybe that is not supported anyways. It also does not happen determinisitcally. It just caused me to stare at these lines for a while and that's where I realized that there might be an issue.

EDIT: CC @fujitatomoya

@felixdivo
Copy link
Copy Markdown
Contributor Author

Side note: Why are these signoff things required (I did read CONTRIBUTING.md)? I see basically no other projects use them and it makes contribting kind of a pain. E.g. we cannot add changes via comments and the defaults in most IDEs do not include this piece of text. Sure, no big deal but if I'm changing one line (e.g. some small typo, type annotation, ...) online and it has me clone the repo, undo commits, add the sign-offs, ... it makes contributing many times slower and often keeps me from fixing stuff because it is plainly annoying. Is this really legally required?

@fujitatomoya
Copy link
Copy Markdown
Collaborator

Do you happen to know how https://github.com/felixdivo/ros2-easy-test/actions/runs/5035009110/jobs/9030212775#step:9:116 can happen in theory? i could not figure this out how even this happens...

I guess in my case it could be a race condition, since I access the executor from different threads, where I think it makes sense that it can occur. I accidentially found #1079, so maybe that is not supported anyways. It also does not happen determinisitcally. It just caused me to stare at these lines for a while and that's where I realized that there might be an issue.

EDIT: CC @fujitatomoya

@felixdivo thanks for sharing. yeah probably that is not supported, #1079 is the same situation. but generating exception should be avoided even if it is not supported.

@clalancette
Copy link
Copy Markdown
Contributor

Side note: Why are these signoff things required (I did read CONTRIBUTING.md)?

In short, it is the lightest-weight thing we have to assure that contributors are allowed to contribute the code that they are providing. The other option would be a CLA, which is far more cumbersome and invasive.

E.g. we cannot add changes via comments and the defaults in most IDEs do not include this piece of text.

For what it is worth, you can always type it in by hand when making the commit message, and that will make the bot happy. Presumably you can also convince your IDE to append it to the commit message by default, particularly since it is a standard git commit flag (-s).

@fujitatomoya
Copy link
Copy Markdown
Collaborator

@felixdivo if you are comfortable with #1129 (comment), could you address DCO error? and i will start the CI.

@felixdivo felixdivo force-pushed the fix-iteration-executor branch from ae4f60f to 0266be5 Compare May 25, 2023 12:40
@felixdivo
Copy link
Copy Markdown
Contributor Author

@clalancette @fujitatomoya Thank you for explaining this. It's really a shame that we have to do this. I know you probably thought a lot about this, but a CLA is only signed once, which IMHO makes it easier. And regarding the legal consequences, it should not be more invasive.

Anyways, let's drop this discussion here since it has nothing to do with the changes in this PR. 😅

felixdivo added 2 commits May 25, 2023 12:47
Signed-off-by: Felix Divo <4403130+felixdivo@users.noreply.github.com>
Signed-off-by: Felix Divo <4403130+felixdivo@users.noreply.github.com>
@felixdivo felixdivo force-pushed the fix-iteration-executor branch from 0266be5 to ece5018 Compare May 25, 2023 12:49
@fujitatomoya
Copy link
Copy Markdown
Collaborator

@clalancette are you good to go?

@fujitatomoya
Copy link
Copy Markdown
Collaborator

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

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.

3 participants