question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Concurrency issues when adding labels to an issue/PR

See original GitHub issue

Hi,

Some context: we are using the Hub4j GitHub API for our Quarkus Bot (it’s a GitHub App based on Quarkus and running as a GraalVM native executable).

The bot can automatically add labels based on triage rules but we started seeing concurrency issues when someone adds labels when the bot is also adding some. Believe it or not, this happened in real life.

AFAICS, the issue is that the GHIssue#addLabels() method doesn’t really add the labels but set them. My understanding is that it should use this method: https://docs.github.com/en/rest/reference/issues#add-labels-to-an-issue and that’s not what is done here: https://github.com/hub4j/github-api/blob/6d86cfb4f60642ccfc3ad943eeb472e33e2ff9ec/src/main/java/org/kohsuke/github/GHIssue.java#L362-L374 : you set the labels based on the existing ones + the added ones instead of adding them, which can result in data loss if you’re not lucky.

The issue occurs when a label is added manually in the UI between the call at line 365 and the call at line 373: the labels added in the UI are lost, which is very unfortunate given they are critical to our workflow. You can see an example of this issue here: https://github.com/quarkusio/quarkus/pull/15402#event- - Georgios added the triage/backport? label in the UI and the bot removed it while our bot is only adding labels.

Does it make any sense? Any chance this could be fixed?

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
gsmetcommented, Mar 20, 2021

@bitwiseman thanks a ton for the release!

0reactions
gsmetcommented, Mar 18, 2021

@bitwiseman if it’s not too much work, could you release a new version with this fix? It’s hitting us pretty bad. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support labels by name in concurrency groups #1468 - GitHub
If you only want to pick specfic label names as concurrency group, you could use contains to check if the label is present....
Read more >
Concurrency Issues in InfoSphere MDM - IBM
This is a typical concurrency issue in the product. The best option to avoid this behavior is to change the business process to...
Read more >
Set Variable in Apply To Each Concurrency Control Message
Using a Set Variable will not always cause you issues. It all depends on what you are doing inside the loop. But as...
Read more >
Update GLEX to resolve concurrency issues - GitLab.org
Update GLEX to resolve concurrency issues. There are bugs that have been fixed in GLEX that we want in the gitlab project.
Read more >
Concurrency issues in JavaFX GUI Updater utility class
I was able to fix the issue myself. After a few days of adding ... setTitle("JavaFXTest"); // Add a few Labels and a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found