fix(user): prevent permanent import lockout on unchecked exceptions#3779
Open
Priyasharma620064 wants to merge 1 commit intoeclipse-sw360:mainfrom
Open
fix(user): prevent permanent import lockout on unchecked exceptions#3779Priyasharma620064 wants to merge 1 commit intoeclipse-sw360:mainfrom
Priyasharma620064 wants to merge 1 commit intoeclipse-sw360:mainfrom
Conversation
GMishx
requested changes
Mar 2, 2026
Comment on lines
+218
to
220
| } finally { | ||
| IMPORT_DEPARTMENT_STATUS.set(false); | ||
| } |
Member
There was a problem hiding this comment.
finally block will always run irrespective if there was an exception or not. This will result in IMPORT_DEPARTMENT_STATUS to always be false.
The IMPORT_DEPARTMENT_STATUS flag in UserDatabaseHandler.importFileToDB() is only reset inside try and catch(IOException). Any unchecked exception leaves the flag stuck at true, permanently disabling department import until server restart. - Move flag reset to finally block for guaranteed reset - Replace static boolean with AtomicBoolean.compareAndSet() for thread-safe guarding between Timer scheduler and Thrift request threads closes eclipse-sw360#3778 Signed-off-by: Priya Sharma <priyasharma1001a@gmail.com>
2b7c5ab to
9a7ffa7
Compare
Contributor
Author
|
Thanks @GMishx! Updated — moved log writes inside finally so the flag resets only after all work is done. Also added catch (Exception e) to handle unchecked exceptions gracefully. Please re-review! |
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.
Summary
Fixes the IMPORT_DEPARTMENT_STATUS flag in UserDatabaseHandler.importFileToDB() which can get permanently stuck at true after an unchecked exception, disabling department import until server restart.
-This PR fixes issue #3778 by moving the flag reset to a finally block and replacing the plain static boolean with AtomicBoolean.compareAndSet() for thread-safe guarding.
-No new dependencies added. AtomicBoolean is part of java.util.concurrent.atomic (standard JDK).
Issue: #3778
Suggest Reviewer
@GMishx
How To Test?