1

Topic: Thread was being aborted

All greetings! Sometimes successively (once a month, but recently couple of days was), in service process.Net arises error ThreadAbortException (message Thread was being aborted). Judging by the description in MSDN - such error is possible if to a flow explicitly told Abort, but in our code such is not present (used libraries also it is possible to eliminate). Why then arises??? Very strange. From details: in all cases, the error happened in different places of our code which was fulfilled from Task. Also during such moments much Task could be launched and high CPU loading. But if thus the torn off operation then to restart, , that is matter is not in the most executable  to procedure. In the stack  anything interesting (our code) which suddenly in the arbitrary place is interrupted with such error. A host is IIS, and it happens at web application start, are launched  that certain initialization, but not necessary was asynchronously fulfilled at once. In flow of the subsequent operation such . It is exact not domain outswapping ( the domain only rose also remaining starting  continue operation). It is exact not in the course of http-inquiry handling, i.e. not because of possible redirects. Somebody faced a similar problem? Where to dig?... upd - the answer was business it appeared in the following. Before start of planned asynchronous initialization, had time to arrive http-rekvest and initialization went synchronously in a flow of it . The request was on the asynchronous controler (mvc3) which had  AsyncTimeout.  initialization went long  transited and asp.net is visible  a worker thread  (about what in an event-broad gull  and there was a message second in a second coincided with already our broad gull about an error).

2

Re: Thread was being aborted

Hello, MadHuman, you wrote: MH> Somebody faced a similar problem? Where to dig?... The plausible reason is an outswapping of the domain or process end, i.e. only the consequence gets to a broad gull. Less probable - the host (iis) raged, here this and this ( in ) gifts from bcl. It is possible to make a knight's move, we exhaust all assembly in ilspy, we look, who pulls methods Thread. Abort ().

3

Re: Thread was being aborted

Hello, Sinix, you wrote: Thanks, for ideas! S> the plausible reason is an outswapping of the domain or process end, i.e. only the consequence gets to a broad gull. It is exact not domain outswapping. A host is IIS, and normally it happens at web application start, are launched  that certain initialization, but not necessary was asynchronously fulfilled at once. In flow of the subsequent operation such . Not domain outswapping,  so falls only any one initialization, remaining successfully transit. S> less probable - the host (iis) raged, here this and this ( in ) gifts from bcl. It happens not in the course of http-inquiry handling, i.e. a possible redirect (and "a gift from bcl") here not and. (Added a start post this information).

4

Re: Thread was being aborted

Hello, MadHuman, you wrote: MH> used libraries also can be eliminated Whence such confidence?

5

Re: Thread was being aborted

Hello, Sharov, you wrote: S> Hello, MadHuman, you wrote: MH>> used libraries also can be eliminated S> Whence such confidence? At initialization of the web application and actually by operation of our procedures of initialization, they are not used (except bcl certainly). Are used already by operation, strongly later. Theoretically certainly it is possible that in any class-constructor-e in them could be Thread. Abort but who in senses the such will do) well and under a microscope them considered, is not present in them Thread. Abort.

6

Re: Thread was being aborted

Hello, MadHuman, you wrote: MH> It is exact not domain outswapping. A host is IIS From it and it was necessary to begin Sm this link https://haacked.com/archive/2011/10/16/ … -net.aspx/ It is hung  on unhandled exception and domain unload events if it is found nothing - we check the stack, the exception all the same  is possible threw out. Is not present - sm the previous council about ilspy and thread. Abort (). As a variant, it is possible to catch through etw trace, but it is necessary to search for manuals. https://blogs.msdn.microsoft.com/tess/2 … w-tracing/ to begin with. UPD, yes, in  IIS other applications are not present a case?

7

Re: Thread was being aborted

Hello, Sinix, you wrote: S> the Sm this link S> https://haacked.com/archive/2011/10/16/ … -net.aspx/ S> Is hung  on unhandled exception and domain unload events if abortion happens only in one flow, and remaining other asynchronous initialization (it is visible on our broad gulls) remain and completed, and actually all works normally (except those places which calculated on  initialization), same unambiguously speaks about that that AppDomain has not been banged, truly? S> if it is found nothing - we check the stack, the exception all the same  is possible threw out. It is not absolutely clear that there it is possible to see, in our case the stack-trejs came to an end on one of nothing of remarkable our functions. In which well there can not be an error in any way. I.e. it is just similar on present  abortion when wounds-times practically in the arbitrary place interrupts normal operation with such error. S> is not present - sm the previous council about ilspy and thread. Abort (). In our code of 100 % is not present. Exterior libraries at this stage are not used yet, means cannot cause such, truly? S> as a variant, it is possible to catch through etw trace, but it is necessary to search for manuals. S> https://blogs.msdn.microsoft.com/tess/2 … w-tracing/ to begin with. It yet did not light up, but thanks. S> UPD, yes, in  IIS other applications are not present a case? No. All happens on separate VDS with Win2008 r2 web, it is unique . It is adjusted so that   time a day, actually at start such  sometimes (rarely) and happens. In flow of day all , never the similar was fixed. All the same it is somehow connected to operation of procedures of initialization,  at abortions the stack-trejsy only in them. Whether there are what other reasons (except an explicit call someone Thread. Abort) when a welt-time proceeding from any reasons  a flow?.

8

Re: Thread was being aborted

Hello, MadHuman, you wrote: S>> It is hung  on unhandled exception and domain unload events, MH> if abortion happens only in one flow, and remaining other asynchronous initialization (it is visible on our broad gulls) remain and completed, and actually all works normally (except those places which calculated on  initialization), same unambiguously speaks about that that AppDomain has not been banged, truly? In the theory yes, in practice check up all versions at once Besides,  a host can  not only the domain entirely, but also separate flows is better.  to unwinding did not find, on storage. Whether MH> there are what other reasons (except an explicit call someone Thread. Abort) when a welt-time proceeding from any reasons  a flow?. Yes. While it is most of all similar here to it https://stackoverflow.com/questions/434 … in-asp-net And still a variation on the same subject: https://stackoverflow.com/questions/234 … nd-thread. https://stackoverflow.com/a/21045242 I would look at broad gulls IIS + checked up that no IIS units of type of a wcf-host interfere.

9

Re: Thread was being aborted

Hello, Sinix, you wrote: whether MH>> there are what other reasons (except an explicit call someone Thread. Abort) when a welt-time proceeding from any reasons  a flow?. S> yes. While it is most of all similar here to it S> https://stackoverflow.com/questions/434 … in-asp-net not our case. There the reason -   after the inactivity period. S> I would look at broad gulls IIS + checked up that no IIS units of type of a wcf-host interfere. Here it helped, like obvious, but did not glance business it appeared in the following. Before start of planned asynchronous initialization, had time to arrive http-rekvest and initialization went synchronously in a flow of it . The request was on the asynchronous controler (mvc3) which had  AsyncTimeout.  initialization went long  transited and asp.net is visible  a worker thread  (about what in an event-broad gull and there was a message second in a second coincided with already our broad gull about an error). Thanks

10

Re: Thread was being aborted

Hello, MadHuman, you wrote: MH> business appeared in the following. MH> before start of planned asynchronous initialization, had time to arrive http-rekvest and initialization went synchronously in a flow of it . Perfectly that was Generally, with iis th many unobvious and feeblly documentary things and to discard versions to unwinding it is not necessary, itself I booze time came across. The broad gulls and broad gulls  rescue, yes.

11

Re: Thread was being aborted

Hello, Sinix, you wrote: S> Generally, with iis th many unobvious and feeblly documentary things and to discard versions to unwinding it is not necessary, itself I booze time came across. The broad gulls and broad gulls  rescue, yes. On my experience (year 4 I support a web service), riddles with iis th was a little.  marvelously well itself recommended as a Web server and I at all will not remember surprises with it. From good features, it is pleasant that if suddenly  worker process happens (always was through our fault, in the core because of ),  itself . It is really useful. One of the most unpleasant was - earlier when  gathered , from application in any way about it was not to learn to fulfill necessary  actions. But already there is a method for this purpose.