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

SLI-1816 Interrupting the branch matching computation should not cause an error #1292

Merged

Conversation

eray-felek-sonarsource
Copy link
Contributor

@eray-felek-sonarsource eray-felek-sonarsource commented Jan 28, 2025

Copy link
Member

@nquinquenel nquinquenel left a comment

Choose a reason for hiding this comment

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

I think we should just catch the interruption at the future level, not the whole method

@eray-felek-sonarsource eray-felek-sonarsource force-pushed the feature/ef/SLI-1816-dont-throw-noisy-error branch 2 times, most recently from ea3f744 to 63ff89d Compare January 29, 2025 14:01
Copy link
Member

@nquinquenel nquinquenel left a comment

Choose a reason for hiding this comment

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

LGTM

@eray-felek-sonarsource eray-felek-sonarsource force-pushed the feature/ef/SLI-1816-dont-throw-noisy-error branch from 63ff89d to 5c8b7e6 Compare January 29, 2025 14:38
@eray-felek-sonarsource eray-felek-sonarsource force-pushed the feature/ef/SLI-1816-dont-throw-noisy-error branch from 5c8b7e6 to ae7b7ce Compare January 29, 2025 16:06
}
})
return computeOnPooledThread(project, "Waiting for branch matching result") { resultFuture.get() }
return computeOnPooledThread(project, "Waiting for branch matching result") {
try {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think you need this try/catch here?

@@ -644,11 +649,27 @@ object SonarLintIntelliJClient : SonarLintRpcClientDelegate {
PerformInBackgroundOption.ALWAYS_BACKGROUND
) {
override fun run(indicator: ProgressIndicator) {
val result = repo.electBestMatchingServerBranchForCurrentHead(mainBranchName, allBranchesNames) ?: mainBranchName
resultFuture.complete(result)
try {
Copy link
Member

Choose a reason for hiding this comment

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

I think you can reuse FutureUtils.waitForTask, it seems very similar

@eray-felek-sonarsource eray-felek-sonarsource merged commit a934393 into master Jan 31, 2025
30 checks passed
@eray-felek-sonarsource eray-felek-sonarsource deleted the feature/ef/SLI-1816-dont-throw-noisy-error branch January 31, 2025 11:45
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.

2 participants