Skip to content

Fix for empty read in ReadImmediate and window / test_alt_timeoutreader tags mode: split immediate read into 2 phases#205

Merged
ldemailly merged 2 commits intossh_hooksfrom
issue_204
Nov 19, 2025
Merged

Fix for empty read in ReadImmediate and window / test_alt_timeoutreader tags mode: split immediate read into 2 phases#205
ldemailly merged 2 commits intossh_hooksfrom
issue_204

Conversation

@ldemailly
Copy link
Copy Markdown
Member

@ldemailly ldemailly commented Nov 19, 2025

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR attempts to address issue #204 related to empty reads in ReadImmediate by introducing a timing-based workaround for a goroutine scheduling race condition. The changes modify the synchronization behavior between the caller and the background reader goroutine.

  • Changed inputChan from buffered to unbuffered to enforce synchronous handoff
  • Added a time.Sleep workaround in ReadImmediate to allow the reader goroutine time to execute
  • Commented out an alternative retry approach in FPSTicks that would have handled empty reads at a higher level

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
timeoutreader.go Modified channel buffering and added time-based synchronization workaround to address race condition in ReadImmediate
ansipixels/ansipixels.go Commented out alternative retry logic for handling empty immediate reads

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ldemailly ldemailly changed the title Fix (not a great one) for empty read in ReadImmediate and window / test_alt_timeoutreader tags mode Fix for empty read in ReadImmediate and window / test_alt_timeoutreader tags mode: split immediate read into 2 phases Nov 19, 2025
@ldemailly ldemailly requested a review from Copilot November 19, 2025 17:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ldemailly ldemailly merged commit 9b318b4 into ssh_hooks Nov 19, 2025
6 checks passed
ldemailly added a commit that referenced this pull request Nov 20, 2025
… ansipixels, with better name than ReadDirect. Fix windows every other frame read delay in FPSTicks (#203)

* Simplify InterruptReader facade and specify it as Input interface for ansipixels, with better name than ReadDirect

* Update ansipixels/ansipixels.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Make GetSize() pluggable

* Expose the goroutine based timeoutreader for all OSes, on unix, with FDs, the select based one is still used/selected

* take io.Reader in constructor for the non unix fd version

* Allow the timeoutreader to fullfill ansipixels.InputReader directly

* Fix for empty read in ReadImmediate and window / test_alt_timeoutreader tags mode: split immediate read into 2 phases (#205)

* Add ResizeSignal and simplify that code so sshd can work on windows too

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ldemailly ldemailly deleted the issue_204 branch January 19, 2026 23:14
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