Skip to content

fix(prompt): remove GetTagNameFromUser() that caused deadlock#681

Merged
bupd merged 3 commits into
goharbor:mainfrom
rshdhere:fix/deadlock-in-prompt
Mar 31, 2026
Merged

fix(prompt): remove GetTagNameFromUser() that caused deadlock#681
bupd merged 3 commits into
goharbor:mainfrom
rshdhere:fix/deadlock-in-prompt

Conversation

@rshdhere

@rshdhere rshdhere commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

solves #680
The function had an empty goroutine that never sent to the unbuffered channel, causing any caller to block indefinitely. Since this function was unused and GetTagFromUser() already provides the correct implementation for tag selection, removing it entirely is the cleanest fix. Fixes #680

@rshdhere rshdhere force-pushed the fix/deadlock-in-prompt branch from 3070b64 to f8001bf Compare February 7, 2026 01:22
@rshdhere

rshdhere commented Feb 7, 2026

Copy link
Copy Markdown
Contributor Author

PTAL @NucleoFusion

@qcserestipy qcserestipy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for this contribution. I think the comment might be removed. Otherwise LGTM

Comment thread pkg/prompt/prompt.go Outdated

return <-repoName
}
// GetTagNameFromUser was removed - it contained a deadlock bug (empty goroutine

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we can remove it without leaving a comment. So far no one used it and will not miss it, I guess

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sorry for the delay was busy with school, on it now!

The function had an empty goroutine that never sent to the unbuffered
channel, causing any caller to block indefinitely. Since this function
was unused and GetTagFromUser() already provides the correct
implementation for tag selection, removing it entirely is the cleanest fix.
Fixes goharbor#680

Signed-off-by: raashed <mohammedraashed10@gmail.com>
- Eliminate `GetTagNameFromUser` containing empty goroutine that never sent to channel, causing deadlock[1][2]
- Retain `GetTagFromUser` as corrected replacement that properly fetches and displays tags[1]

Signed-off-by: raashed <mohammedraashed10@gmail.com>
Signed-off-by: raashed <mohammedraashed10@gmail.com>
@rshdhere rshdhere force-pushed the fix/deadlock-in-prompt branch from a342949 to 383c254 Compare February 14, 2026 17:07
@rshdhere

Copy link
Copy Markdown
Contributor Author

rebased and ready to be merged @qcserestipy

@NucleoFusion NucleoFusion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm
Thanks for the contribution

@bupd bupd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@bupd bupd merged commit f919c23 into goharbor:main Mar 31, 2026
1 check passed
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.

bug: GetTagNameFromUser() causes deadlock due to empty goroutine

4 participants