Waldemar Kornewald
12/02/2025, 6:01 PMArtem Olkov
12/03/2025, 1:32 PMCancellationException in production? If so - how do you solve this problem at the moment?
Do you mind providing an example of a code, demonstrating the problem you are talking about?Waldemar Kornewald
12/03/2025, 1:51 PMwithTimeout which uses a special TimeoutCancellationException which one has to distinguish from a full coroutine cancellation. Sometimes we define custom subclasses of CancellationException because that's the only exception type which is (by convention) re-thrown and bubbles up through all layers in the code (without triggering error handling logic) in order to signal a cancellation to an outer layer, but doesn't cause a full coroutine cancellation. It's the same principle as withTimeout where an inner layer signals cancellation and an outer layer catches that exception and handles it in some special way - without letting it bubble up further. (side-note: withTimeout has a design flaw because TimeoutCancellationException should only happen within the block, but not bubble out of the withTimeout function call and instead get converted to an actual non-cancellation error type)Artem Olkov
12/04/2025, 9:25 AM