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

fix: correctly stopping gpsd thread #5585

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

sfiorani
Copy link
Contributor

This PR fixes a bug that happened when the PositionService provider was switched from gpsd to an other service (MM or Serial): after applying the new configuration in the PositionProvider tab and refreshing the WebUI, the latter get stuck. In general, each call to the PositionService for a certain time after the switch would be stopped due to this problem.

This happened because when the stop method was called, the code would take all the time allowed in the executor.awaitTermination(1, TimeUnit.MINUTES) before killing the thread, resulting in blocking the web ui that asks to update its location information.

The cause of the long await was that the Future<?> was not canceled before the calling to the executor.shutdown(), so the latter would fall in a bad state that required the thread kill.

Now before the shutdown of the thread, the Future<?> is canceled and the web ui is not blocked.


Related Issue: This PR fixes/closes {issue number}

Description of the solution adopted: A more detailed description of the changes made to solve/close one or more issues. If the PR is simple and easy to understand this section can be skipped

Screenshots: If applicable, add screenshots to help explain your solution

Manual Tests: Optional description of the tests performed to check correct functioning of changes, useful for an efficient review

Any side note on the changes made: Description of any other change that has been made, which is not directly linked to the issue resolution [e.g. Code clean up/Sonar issue resolution]

@MMaiero MMaiero merged commit 4e89455 into eclipse-kura:develop Nov 26, 2024
4 checks passed
eclipse-kura-bot pushed a commit that referenced this pull request Nov 26, 2024
Signed-off-by: SimoneFiorani <[email protected]>
(cherry picked from commit 4e89455)
MMaiero pushed a commit that referenced this pull request Nov 27, 2024
fix: correctly stopping gpsd thread (#5585)

Signed-off-by: SimoneFiorani <[email protected]>
(cherry picked from commit 4e89455)

Co-authored-by: sfiorani <[email protected]>
MMaiero pushed a commit that referenced this pull request Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants