Skip to content

fix(fossology): reset IN_WORK state on upload exception to prevent stuck clearingState#4065

Open
Aman-Cool wants to merge 1 commit intoeclipse-sw360:mainfrom
Aman-Cool:fix/fossology-upload-stuck-in-work-state
Open

fix(fossology): reset IN_WORK state on upload exception to prevent stuck clearingState#4065
Aman-Cool wants to merge 1 commit intoeclipse-sw360:mainfrom
Aman-Cool:fix/fossology-upload-stuck-in-work-state

Conversation

@Aman-Cool
Copy link
Copy Markdown
Contributor

When sending a release to FOSSology, the handler writes IN_WORK to CouchDB before the upload attempt. If anything throws during the attachment fetch or network call, that state never gets cleaned up; leaving the release permanently stuck at SENT_TO_CLEARING_TOOL with no way to retry without admin intervention.

  • Wrapped the step-handler dispatch in a try/catch/finally so updateFossologyProcessInRelease always runs, and any upload step interrupted mid-flight gets reset back to NEW.
  • No new dependencies.

Issue: NA

Suggest Reviewer

@GMishx

How To Test?

  1. Attach a source file to a release and configure FOSSology.
  2. While clicking "Send to FOSSology", briefly make the CouchDB attachments DB unreachable (or revoke read access).
  3. Before fix: release stays at SENT_TO_CLEARING_TOOL, every retry silently does nothing.
  4. After fix: release resets to NEW_CLEARING, retry works normally.

No new automated tests added, the fix is in exception-path control flow.

Checklist

Must:

  • All related issues are referenced in commit messages and in PR

@Aman-Cool
Copy link
Copy Markdown
Contributor Author

Hey @GMishx, Found this while digging into the FOSSology flow; if the attachment fetch or any I/O throws between the pre-commit IN_WORK write and the actual upload, there's no cleanup path, so the release just silently hangs there forever. Pretty easy to hit during a CouchDB hiccup or rolling restart. The fix is just a try/catch/finally to make sure the state always gets corrected before we rethrow. Happy to add a test or tweak anything if needed!

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.

1 participant