New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why sometimes happens System.Threading.ThreadAbortException: Thread was being aborted. #21145
Comments
During normal runtime shutdown all background threads are being aborted. I suspect this is the culprit |
👎 Application has continued to work. Runtime was not shutdown |
AppDomain unloading can also trigger aborts for threads running code in that domain. |
What is unloading? Application continue to work! |
Again it happened but this time with Thread class
I think that it exists something bad in this managed-to-native |
Did you fin a solution for this ? |
No I did not. I notice that it happens often when use Task.Run() with Thread.Sleep() inside body. I've even found some recommendation from Microsoft to not use Task for long time execution. Therefore I decide to use new Thread().Start() instead Task.Run() but it resolves problem particularly |
Steps to Reproduce
It can not be reproduced always because it happens very very rarely
Current Behavior
System.Threading.ThreadAbortException: Thread was being aborted.
Expected Behavior
executing code from start to finish
On which platforms did you notice this
[ ] macOS
[*] Linux Arch
[ ] Windows
Version Used:
mono 5.2
Stacktrace
RUNTIME CONTINUED TO EXECUTE AFTER THIS ThreadAbortException!!! I want to understand why thread was aborted. And what may I do in order to thread works fine!
The text was updated successfully, but these errors were encountered: