Skip to content

FF: allow PipeReader to read from overflowBuffer promptly#6833

Merged
peircej merged 1 commit intopsychopy:releasefrom
mh105:release-pipe-overflow
Sep 6, 2024
Merged

FF: allow PipeReader to read from overflowBuffer promptly#6833
peircej merged 1 commit intopsychopy:releasefrom
mh105:release-pipe-overflow

Conversation

@mh105
Copy link
Copy Markdown
Contributor

@mh105 mh105 commented Sep 5, 2024

Right now if stdout gets crowded by multiple printouts, the _overflowBuffer will catch them during the PipeReader.run() method. However, the for-loop of self._fdpipe.readline is dependent on new lines being added to the pipe. This means leftover bytes from the _overflowBuffer won't print out correctly to the runner stdout panel until the next message is printed, which could be never - so they only get printed at termination of the experiment.

This commit adds the ability to put the leftover bytes from _overflowBuffer into _queue as soon as the _queue is freed up, by coupling it into the isAvailable() method. This behavior is much smoother, without adding much blocking, and is consistent with what the existing comment in PipeReader.run() says:

# Put bytes into buffer if the queue hasn't been emptied quick
# enough. These bytes will be passed along once the queue has
# space.

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.61%. Comparing base (60088ec) to head (194e456).
Report is 18 commits behind head on release.

Additional details and impacted files
@@           Coverage Diff            @@
##           release    #6833   +/-   ##
========================================
  Coverage    49.61%   49.61%           
========================================
  Files          332      332           
  Lines        61167    61173    +6     
========================================
+ Hits         30348    30354    +6     
  Misses       30819    30819           
Components Coverage Δ
app ∅ <ø> (∅)
boilerplate ∅ <ø> (∅)
library ∅ <ø> (∅)
vm-safe library ∅ <ø> (∅)

@peircej peircej merged commit 99c0eeb into psychopy:release Sep 6, 2024
@mh105 mh105 deleted the release-pipe-overflow branch September 22, 2024 16:27
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