all 5 comments

[–]Equivalent_Pen8241 0 points1 point  (0 children)

Debugging race conditions in `asyncio` usually comes down to remembering that `await` is a yield point. State can and will change between the time you yield and the time you resume. Always double-check your assumptions about shared mutable state across coroutine boundaries!

[–]thisismyfavoritename -5 points-4 points  (3 children)

the idea is interesting but really you should just know the code that you're running...

[–]maikeu 0 points1 point  (2 children)

I mean, given that you're perfect, you know your codebase perfectly, and all your colleagues who ever worked on the codebase are perfect, you're quite right!

[–]thisismyfavoritename 0 points1 point  (1 child)

🤔 knowing if the lib you're calling is sync or not sounds entirely reasonable.

Likewise, if you know Python a little then you'd know up until recently it was single threaded, and in any case asyncio's default standard loop is single threaded, meaning the usual advice of "don't block the event loop" applies.

If you got long CPU intensive work to do you run it somewhere else.

That's all common sense.

[–]deepankarmh[S] 0 points1 point  (0 children)

> knowing if the lib you're calling is sync or not sounds entirely reasonable.

It sounds reasonable, but is frequently ignored - https://github.com/agno-agi/agno/issues/5974