[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-12-17 Thread Yury Selivanov
Yury Selivanov added the comment: I think that what Nathaniel proposes is very reasonable. The PR is LGTM and I've just merged it. Closing the issue. -- components: +Interpreter Core resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-12-17 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset 902ab80b590e474bb2077b1fae8aac497b856d66 by Yury Selivanov (Nathaniel J. Smith) in branch 'master': bpo-30050: Allow disabling full buffer warnings in signal.set_wakeup_fd (#4792)

[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-12-12 Thread STINNER Victor
STINNER Victor added the comment: > it would be extremely difficult to implement since at the point where the > error occurs, we don't have and can't take the GIL. The signal handler uses Py_AddPendingCall() which calls a C function "later", but it can be anytime,

[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-12-11 Thread Nathaniel Smith
Nathaniel Smith added the comment: Yeah, I agree with Antoine and Victor that a callback would be overkill, and it would be extremely difficult to implement since at the point where the error occurs, we don't have and can't take the GIL. --

[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-12-11 Thread STINNER Victor
STINNER Victor added the comment: As I wrote, I never saw this warning, even while debugging signal issues in asyncio on FreeBSD. I don't think that this is an use case for a callback. Nathaniel use case is just to ignore the warning, I consider that it's a reasonable

[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-12-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I meant a callback that will be called after writing a byte to the wakeup fd is failed. By default it would write a warning to stderr, but the user could specify other callback for silencing a warning or for using other way for

[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-12-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: A custom handler would be overkill IMO. set_wakeup_fd() is really useful for a small category of library (most notably event loop frameworks). -- ___ Python tracker

[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-12-11 Thread Nathaniel Smith
Nathaniel Smith added the comment: Serhiy: I don't know what "specify a custom handler" means in this context. Can you elaborate? The fd buffer overflow happens in a very delicate context where we definitely cannot call python code or even safely touch PyObject* variables.

[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-12-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm now well acquainted with with the signal and asyncio modules, but is this the best solution? Wouldn't be better to specify a custom handler? If this is possible. -- nosy: +serhiy.storchaka

[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-12-10 Thread Nathaniel Smith
Change by Nathaniel Smith : -- keywords: +patch pull_requests: +4691 stage: -> patch review ___ Python tracker ___

[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-06-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: > It would be nice if there were a way to disable this; perhaps something like: > signal.set_wakeup_fd(fd, warn_on_full_buffer=False) That's a reasonable idea. Nathaniel, would you like to submit a PR for this? -- nosy: +pitrou

[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-04-12 Thread Nathaniel Smith
Nathaniel Smith added the comment: I haven't noticed the error in the wild because I don't use set_wakeup_fd on Linux/MacOS, because of this issue :-). But on MacOS literally all it would take is to receive two signals in quick succession, or to receive one signal at a moment when someone has

[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-04-12 Thread STINNER Victor
STINNER Victor added the comment: > One way that writing to the wakeup fd can fail is if the pipe or socket's > buffer is already full, in which case we get EWOULDBLOCK or WSAEWOULDBLOCK. Is it a theorical question or did you notice the error in the wild? I mean: without sending a signal in a

[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-04-12 Thread Nathaniel Smith
New submission from Nathaniel Smith: When a wakeup fd is registered via signal.set_wakeup_fd, then the C level signal handler writes a byte to the wakeup fd on each signal received. If this write fails, then it prints an error message to the console. Some projects use the wakeup fd as a way