Skip to content

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

Open
GokulRG wants to merge 1 commit intoapache:mainfrom
GokulRG:GUACAMOLE-827
Open

GUACAMOLE-827 : Fix BlobWriter race condition in chunk upload#1194
GokulRG wants to merge 1 commit intoapache:mainfrom
GokulRG:GUACAMOLE-827

Conversation

@GokulRG
Copy link
Copy Markdown

@GokulRG GokulRG commented Mar 31, 2026

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
Copy link
Copy Markdown
Author

GokulRG commented Apr 1, 2026

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
Copy link
Copy Markdown
Author

GokulRG commented Apr 1, 2026

@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
Copy link
Copy Markdown
Author

GokulRG commented Apr 8, 2026

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

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