5 ms·
Interesting. Is the circuit breaker a feature of .NET running on Windows? To my knowledge, it can't be implemented on Linux + Java or Python (a thread can't be
by aartur 11y ago
Interesting. Is the circuit breaker a feature of .NET running on Windows?
To my knowledge, it can't be implemented on Linux + Java or Python (a thread can't be terminated from outside, and some syscalls involve a whole process).
- eonwe 11y agoI think this can be mostly implemented in Java with bytecode re-writing which will check for the conditions on time to time. Stopping the thread can still leave some of the stuff in indeterminate state if the thread has some resources it needs to release manually.
- togusa 11y agoIt's a library I wrote. The time breaker is actually quite complicated. It is a wrapper that sets up some global parameters on the thread for timeouts on async/await calls and handles the timeout conditions. It integrates with our own async wrappers for external http calls, message delivery, query execution etc. It only enforces that all aggregate async calls will complete or fail by the end of the timeout period. Realistically this is usually around the 500-800ms space as load spikes can break everything otherwise.
- Too 11y ago.net has a public thread.abort function which allows this, it will result in a interruptedexception on the aborted thread. I think there are ways to do this in java and python also although I know the official stance on thread.abort from the python maintainers is no way in hell.