Re: [Async-sig] avoiding accidentally calling blocking code

2018-02-12 Thread Andrew Svetlov
loop.slow_callback_duration + PYTHONASYNCIODEBUG=1 Does it fork for you? Do you need extra info? On Tue, Feb 13, 2018 at 7:07 AM Dima Tisnek wrote: > Let me try to answer the question behind the question. > > Like any code validation, it's a healthy mix of: > * unit tests [perhaps with > mock.pa

Re: [Async-sig] avoiding accidentally calling blocking code

2018-02-12 Thread Dima Tisnek
Let me try to answer the question behind the question. Like any code validation, it's a healthy mix of: * unit tests [perhaps with mock.patch_all_known_blocking_calls(side_effect=Exception)] * good judgement [open("foo").read() technically blocks, but only a problem on network filesystems] * monit

[Async-sig] avoiding accidentally calling blocking code

2018-02-12 Thread Chris Jerdonek
Hi, This is a general Python async question I've had that I haven't seen a discussion of. Do people know of any techniques other than manually inspecting code line by line to find out if you're accidentally making a raw call to a blocking function in a coroutine? Related to this, again, outside o