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

Iterate subprocesses in-place #2373

Merged

Conversation

maxfischer2781
Copy link
Contributor

Summary

This PR fixes a subtle iterate-remove bug when checking subprocesses. Previously, subprocesses were deleted by index, which would shift the remaining processes and their index to go out of sync. This caused the wrong process to be deleted if more than one died in a cycle. See #2372.

Instead of being deleted-appended, process are now replaced inplace to ensure positions and thus iteration is stable. This also makes copying the process list superfluous, so I removed this where appropriate.

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

@abersheeran
Copy link
Member

This is definitely an oversight on my part.

@Kludex Kludex changed the title replace suprocesses inplace Iterate subprocesses in-place Jun 28, 2024
@Kludex Kludex merged commit c23cd24 into encode:master Jun 28, 2024
15 checks passed
@Kludex
Copy link
Member

Kludex commented Jun 28, 2024

If someone creates a release PR (changelog + version change), I can make a release.

@vvanglro
Copy link
Contributor

vvanglro commented Jul 3, 2024

If someone creates a release PR (changelog + version change), I can make a release.

Done. #2380

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.

4 participants