-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable output buffering by default #595
Comments
+1 for disabling output buffer default. and we can guide user how to enable buffer it if user wants. i think that could be more friendly for user. |
I'm OK with changing the default behavior of the CLI to be unbuffered by default. I just want to make sure that:
|
We could use stderr for logging which is always unbuffered, though that might be confusing. We can also use the |
I'm kind of against doing it this way. I think that for any new code, it is going to be really easy to forget to do it (and for the reviewer to notice that it is missing). What if we instead set |
I don't think you can do that exactly, IIUC I will take a look if I can find an easy way to do it, or apply one of the hacky ways to do it. |
Feature request
Feature description
The current default of Python buffering output can lead to undesirable behavior when working with
ros2cli
tools. For example,won't output messages right away unless I disable buffering with
PYTHONUNBUFFERED=1
.I've created this ticket to discuss if we should default to disabling output buffering. Though we've had this discussion related to other features/tools in ROS 2, I couldn't find much about the CLI tools (just this: #588).
Implementation considerations
Cons:
Disabling output buffering can lead to performance issues. But, I'd argue that it would be acceptable presuming these tools are primarily used for debugging, and they are not very performant as-is.
Pros:
Users won't get confused when they rely on output of
ros2cli
tools not immediately being fed into another process.E.g. tests won't have to explicitly set PYTHONUNBUFFERED.
The text was updated successfully, but these errors were encountered: