Skip to content

Conversation

@vrozov
Copy link
Member

@vrozov vrozov commented Nov 14, 2025

What changes were proposed in this pull request?

Synchronize access to buffer in SparkShellSuite using existing lock.

Why are the changes needed?

buffer is updated on ProcessOutputCapturer threads and when it is access during exception handling, access to the buffer needs to be locked to avoid using partially updated buffer.

Does this PR introduce any user-facing change?

No

How was this patch tested?

running test

Was this patch authored or co-authored using generative AI tooling?

No

@sarutak
Copy link
Member

sarutak commented Nov 15, 2025

@vrozov How about just using a concurrent collection like LinkedBlockingQueue for buffer?

@vrozov
Copy link
Member Author

vrozov commented Nov 17, 2025

@vrozov How about just using a concurrent collection like LinkedBlockingQueue for buffer?

@sarutak Thank you for suggestions. The PR uses existing lock that will be still required even if buffer is changed from ArrayBuffer to LinkedBlockingQueue to synchronize between ProcessOutputCapturer for stdout and stderr. Additionally, queue usage pattern (take one element at a time from head or tail) does not apply well here as it outputs the entire buffer (collection).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants