fix(hooks): prevent panic from loop variable capture in concurrent execution#445
Merged
cmainas merged 1 commit intourunc-dev:main-pr445from Feb 12, 2026
Merged
Conversation
✅ Deploy Preview for urunc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Author
|
@cmainas please have a look |
0854c8d to
0957257
Compare
Contributor
|
Hello @ishaanxgupta , the changes look good, but a rebase over the main branch is required. |
0957257 to
af3ce32
Compare
Author
|
@cmainas done |
Contributor
|
I see another user pushed here @hemang1404 . I do not know how that happened but:
|
7cc0779 to
047662d
Compare
Contributor
|
Hello @ishaanxgupta , please rebase over main so we can merge this. |
047662d to
623e73f
Compare
Author
|
hi @cmainas done with the rebase |
Fix panic from accessing hooks[i] in async execution after loop. Use captured parameter h instead. Fixes: urunc-dev#418 Co-authored-by: hemang1404 <hemangsharrma@gmail.com> Signed-off-by: ishaanxgupta <ishaankone@gmail.com>
623e73f to
f1571ef
Compare
cmainas
approved these changes
Feb 12, 2026
Contributor
cmainas
left a comment
There was a problem hiding this comment.
Thank you @ishaanxgupta and @hemang1404 for the fix.
github-actions bot
pushed a commit
that referenced
this pull request
Feb 12, 2026
Fix panic from accessing hooks[i] in async execution after loop. Use captured parameter h instead. Fixes: #418 PR: #445 Co-authored-by: hemang1404 <hemangsharrma@gmail.com> Signed-off-by: ishaanxgupta <ishaankone@gmail.com> Reviewed-by: Charalampos Mainas <cmainas@nubificus.co.uk> Approved-by: Charalampos Mainas <cmainas@nubificus.co.uk>
urunc-bot bot
pushed a commit
that referenced
this pull request
Feb 12, 2026
Fix panic from accessing hooks[i] in async execution after loop. Use captured parameter h instead. Fixes: #418 PR: #445 Co-authored-by: hemang1404 <hemangsharrma@gmail.com> Signed-off-by: ishaanxgupta <ishaankone@gmail.com> Reviewed-by: Charalampos Mainas <cmainas@nubificus.co.uk> Approved-by: Charalampos Mainas <cmainas@nubificus.co.uk>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a loop variable capture bug in executeHooksConcurrently() that could cause panics and incorrect logging when hooks are executed concurrently.
Panic Prevention: Eliminates panic when i == len(hooks) after loop completes
Related issues
How was this tested?
Confirmed the captured parameter h is used consistently in the goroutine
Checked that no other instances of this pattern exist in the function
LLM usage
N/A
Checklist
make lint).make test_ctr,make test_nerdctl,make test_docker,make test_crictl).collaborated with @hemang1404