Grokking Concurrency in Python
0% completed
Cleanup That Survives Cancellation
A finally block makes one promise during a cancellation: the block starts. It makes no promise that the block finishes if a second cancellation arrives at an await inside it. It does not cover a resource that a function has taken but not yet returned to its caller, and it does not reset the count of cancellation requests that the task keeps.
Each of these gaps causes a real failure: records that are never saved during shutdown, a connection pool with no free connections after a burst of timeouts, and a time limit that raises the wrong exception.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%