block: always drain stdout#425
Open
zsugabubus wants to merge 1 commit into
Open
Conversation
If input is not being read until `EAGAIN`, we will not get informed (signaled) when further input arrives.
vivien
added a commit
that referenced
this pull request
Jan 13, 2023
i3blocks currently wrongly assumes that a persistent program will be line buffered (or act as such) and flush one line at a time. In this common scenario, it is safe to read a single line per signal, but there are cases where this behavior is not not wanted. For example, a program may print several lines at once, resulting in updating only the first line, while filling up the pipe and eventually have the block program hang on the next write operation. To fix this, drain the pipe of a persistent block upon reception of a signal, but line by line to avoid breaking non JSON blocks. Also make sure to update a block only after having successfully read its output, to avoid resetting a block on error such as on incomplete line, or when the pipe was already flushed. Closes #422 Refs #425
dllud
pushed a commit
to dllud/i3blocks
that referenced
this pull request
Jan 12, 2024
dunst: update documentation to reflect 99725fb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If input is not being read until
EAGAIN, we will not get informed(signaled) when further input arrives.
Fixes #422.