Skip to content
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

Remove bad pipe message log #1246

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

deshanxiao
Copy link

@deshanxiao deshanxiao commented Jun 7, 2024

This PR is aimed to remove a log when IOPubThread received a mismatch uuid message.

These mismatch messages appear to originate from some firewall and network related components. Jupyter users don't seem to need this information, however it is displayed on the UX.

I search "Bad pipe message" in whole github repos and there are many ipynb files contains this error.

Some similar issue:
spyder-ide/spyder#20591
#1107

@@ -215,7 +215,7 @@ async def _handle_pipe_msg(self, msg=None):
if not self._pipe_flag or not self._is_master_process():
return
if msg[0] != self._pipe_uuid:
print("Bad pipe message: %s", msg, file=sys.__stderr__)
# print("Bad pipe message: %s", msg, file=sys.__stderr__)
Copy link
Member

Choose a reason for hiding this comment

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

These messages do indicate a problem, and should still be logged, not entirely suppressed. The problem comes from the change that sys.__stderr__ is now duplicated and forwarded to users, when this message is meant to only. What we really want to write to is sys.stderr._original_stdstream_copy.

I see two options:

  1. when we capture the low-level __stderr__, we could replace sys.__stderr__ with the new captured fd, so statements like this do what we originally meant them to (only write to stderr, not captured and forwarded), or
  2. keep capturing __stderr__ and explicitly write to the "truly really actually only original stderr" FD for messages like these.

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