Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRepeating calls to connect_write_pipe with sys.stdout as a stream lead to FileExistsError exception #262
Comments
|
Interesting. Why do you think this is a good idea to connect two transports to the same fd? |
|
@1st1 in case you log to stdout from different loggers, where both use stdout as stream handler. |
|
Sure, but then you might have a race condition between these two protocols/transports not synchronizing their writes/reads to the FD. And if you want to do something like that anyways, the preferred solution would be probably to just |
|
@1st1 Thx. I do fully agree regarding But there might be other scenarios (which I am not aware right now), where asyncio would work, and uvoop would not. So the question is - how far |
|
Just my two cents: we had cases when uvloop would raise Non sure if it's relevant or not, and unfortunately cannot provide more info. |
|
Yeah, this definitely needs to be investigated. If anyone wants to help I'd really appreciate that. I myself have no idea when I have time to debug this. |
|
@hh-h The reason the original example does not work is because libuv requires every FD to be registered once. So in order to fix this in uvloop, uvloop itself will have to dup FDs behind the scenes. Which is a bit suboptimal, but I'll think about it.
The only way I can imagine this happening is if you somehow close FDs without closing the transports/protocols that wrap them. In this case, uvloop might have old wrong transports wrapping "new" FDs. Or something else that's crazy like this. What it really means is that you program might work in asyncio and not in uvloop now, but it's only a matter of time until it starts to break horribly in asyncio too. I might be wrong here, but I suggest you to better investigate what's really happening on your end. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

PYTHONASYNCIODEBUGin env?: yesHello, this example doesn't work with uvloop.
please, see discussion here b2wdigital/aiologger#42 (comment)