Skip to content

GUACAMOLE-827: Fix BlobWriter race condition in chunk upload.#1194

Merged
necouchman merged 1 commit into
apache:staging/1.6.1from
GokulRG:GUACAMOLE-827
Jun 24, 2026
Merged

GUACAMOLE-827: Fix BlobWriter race condition in chunk upload.#1194
necouchman merged 1 commit into
apache:staging/1.6.1from
GokulRG:GUACAMOLE-827

Conversation

@GokulRG

@GokulRG GokulRG commented Mar 31, 2026

Copy link
Copy Markdown

Fixes a critical race condition where multiple blob chunks could be read and sent simultaneously without proper ACK synchronization.

Changes:

  • Add in-flight tracking to prevent concurrent chunk operations
  • Register ACK handler BEFORE sendData() to eliminate race window
  • Add duplicate ACK prevention with ackHandled flag
  • Use setTimeout for non-recursive chunk scheduling
  • Reset state on FileReader errors

@GokulRG

GokulRG commented Apr 1, 2026

Copy link
Copy Markdown
Author

This MR should address this longstanding bug where subsequent chunks are sent to the BlobWriter before the previous chunk is fully processed resulting in incomplete file transfers with missing chunks.

@necouchman

Copy link
Copy Markdown
Contributor

@GokulRG Thanks for submitting this. Please fix the style of the PR title and the commit message by adding a ":" after GUACAMOLE-827.

@GokulRG GokulRG changed the title GUACAMOLE-827 Fix BlobWriter race condition in chunk upload GUACAMOLE-827 : Fix BlobWriter race condition in chunk upload Apr 1, 2026
@GokulRG

GokulRG commented Apr 1, 2026

Copy link
Copy Markdown
Author

@GokulRG Thanks for submitting this. Please fix the style of the PR title and the commit message by adding a ":" after GUACAMOLE-827.

Of course. Thank you!

@GokulRG

GokulRG commented Apr 8, 2026

Copy link
Copy Markdown
Author

Hi @necouchman, Were you able to look at this MR?

@eugen-keeper eugen-keeper left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe the fix is correct and necessary. LGTM.
@GokulRG please remove the space before the colon in the PR title and add periods at the end of the commit and PR titles.

@necouchman

Copy link
Copy Markdown
Contributor

@GokulRG Seems like this should be re-based against either patch or staging/1.6.1?

@GokulRG GokulRG changed the title GUACAMOLE-827 : Fix BlobWriter race condition in chunk upload GUACAMOLE-827: Fix BlobWriter race condition in chunk upload Jun 24, 2026
@GokulRG GokulRG changed the title GUACAMOLE-827: Fix BlobWriter race condition in chunk upload GUACAMOLE-827: Fix BlobWriter race condition in chunk upload. Jun 24, 2026
@GokulRG

GokulRG commented Jun 24, 2026

Copy link
Copy Markdown
Author

@eugen-keeper Done. Thanks a lot for the approval.

@GokulRG GokulRG changed the base branch from main to staging/1.6.1 June 24, 2026 09:30
@GokulRG

GokulRG commented Jun 24, 2026

Copy link
Copy Markdown
Author

@necouchman Please let me know if it looks good now. Rebased and changed the base branch to staging/1.6.1

@necouchman necouchman merged commit cedbbd9 into apache:staging/1.6.1 Jun 24, 2026
1 check passed
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.

3 participants