App pool recycling and endpoint hosted in IIS Web Application

340 views
Skip to first unread message

Charles Hebert

unread,
May 14, 2014, 10:35:25 AM5/14/14
to particula...@googlegroups.com
Helpful information to include
Product name: Nservicebus
Version: 4.2
Stacktrace:
Description: 

Hi there,

I'm coming back with this issue, I think I have identified the problem: 

Our web app register to backend events which are handled then forwarded to the user's browser via SignalR.

When the app pool of our web application get recycled, it results in no more notification handled by the endpoint and messages stack in UI's msmq queue.

I don't think disabling the Recycling is an option for us. Any idea ?

Thanks,
Charles


Joe Ratzloff

unread,
May 16, 2014, 5:18:01 PM5/16/14
to particula...@googlegroups.com
I have seen this issue in the group before.  Disabling the app pool recycling seems to be the way to overcome it.

It is one of the side effects of having endpoints hosted in IIS.  http://www.make-awesome.com/2010/10/why-not-publish-nservicebus-messages-from-a-web-application/

As far as work-arounds, perhaps you could disable automatic recycling and instead automate it periodically with a script?

If these messages are still of value to the web client they may still not be active or able to receive them...

Joe. 

Charles Hebert

unread,
May 28, 2014, 9:34:36 AM5/28/14
to particula...@googlegroups.com
Holy cr@ck. 

I think I've found what caused me the issue;
Frontend bus configuration had ImpersonateSender(false) missing... It appears it had something to do with starting the bus after the apppool get recycled.

@Joe Thanks for the link, I'll double check if I have any of these issues.

John Simons

unread,
May 28, 2014, 6:37:35 PM5/28/14
to particula...@googlegroups.com
Hi Charles,

Having ImpersonateSender on or off should not prevent callbacks being fired.
However having the apppool recycle is definitely an issue that affects inflight callbacks since those callbacks mapping is kept in memory, but after the recycling is complete new callbacks should start working again.

Is this what you are seeing?

Cheers
John 

Charles Hebert

unread,
May 29, 2014, 10:24:13 AM5/29/14
to particula...@googlegroups.com
Yes.

But it appears callbacks only "start working again" when ImpersonateSender is off... 

Does ImpersonateSender also Impersonate receiving? Because it really sounds like the user or something is different after completion of apppool recycling and that difference seems to result in my issue (as specified above). 

It may be more esoteric than I thought. ; /
Any idea on what could have caused this then?


Charles   


--
You received this message because you are subscribed to a topic in the Google Groups "Particular Software" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/particularsoftware/AsNHPFo5w7Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to particularsoftw...@googlegroups.com.
To post to this group, send email to particula...@googlegroups.com.
Visit this group at http://groups.google.com/group/particularsoftware.
To view this discussion on the web visit https://groups.google.com/d/msgid/particularsoftware/714ed544-e98b-4e83-a758-b5261477837b%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Simon Cropp

unread,
May 30, 2014, 1:03:43 AM5/30/14
to particula...@googlegroups.com
ImpersonateSender isnt really true impersonation. it only adds a header to the message and exposes that header to the handler of that message. So unless you have some code that is interacting with that header (and failing in some way) it is hard to understand how ImpersonateSender could be the culprit. 

Can you replicate this in lower environments?

Charles Hebert

unread,
May 30, 2014, 10:27:14 AM5/30/14
to particula...@googlegroups.com
I reproduced in the lowest environment I have... And I have no code doing anything with message headers... 


Charles   


2014-05-30 1:03 GMT-04:00 Simon Cropp <simon...@gmail.com>:
ImpersonateSender isnt really true impersonation. it only adds a header to the message and exposes that header to the handler of that message. So unless you have some code that is interacting with that header (and failing in some way) it is hard to understand how ImpersonateSender could be the culprit. 

Can you replicate this in lower environments?

--
You received this message because you are subscribed to a topic in the Google Groups "Particular Software" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/particularsoftware/AsNHPFo5w7Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to particularsoftw...@googlegroups.com.
To post to this group, send email to particula...@googlegroups.com.
Visit this group at http://groups.google.com/group/particularsoftware.

Simon Cropp

unread,
Jun 1, 2014, 7:21:30 PM6/1/14
to particula...@googlegroups.com
And in those lower environments you can reliably show it "failing with ImpersonateSender" and "working without ImpersonateSender"?

Charles Hebert

unread,
Jun 2, 2014, 10:31:45 AM6/2/14
to particula...@googlegroups.com
Yes.


2014-06-01 19:21 GMT-04:00 Simon Cropp <simon...@gmail.com>:
And in those lower environments you can reliably show it "failing with ImpersonateSender" and "working without ImpersonateSender"?

--
You received this message because you are subscribed to a topic in the Google Groups "Particular Software" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/particularsoftware/AsNHPFo5w7Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to particularsoftw...@googlegroups.com.
To post to this group, send email to particula...@googlegroups.com.
Visit this group at http://groups.google.com/group/particularsoftware.

Simon Cropp

unread,
Jun 2, 2014, 9:25:15 PM6/2/14
to particula...@googlegroups.com
Charles

It may be an issue with NServicebus interfering with the current windows identity

In a lower environment can you temporarily update to the latest NSB and check if this fixes the issue?




Charles Hebert

unread,
Jun 3, 2014, 11:21:19 AM6/3/14
to particula...@googlegroups.com
I'll try this if I have any time before I move to a new city and a new job...
Reply all
Reply to author
Forward
0 new messages