Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Channel has already been signaled to stop #42

Closed
kvnhck opened this Issue Sep 24, 2012 · 4 comments

Comments

Projects
None yet
2 participants

kvnhck commented Sep 24, 2012

Hello,

I've created a small webpage to send push notifications. All works fine when running on my development machine in IIS Express.
When I deploy the site to an IIS server I get the following error:

Channel has already been signaled to stop
Object name: 'Channel'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ObjectDisposedException: Channel has already been signaled to stop
Object name: 'Channel'.

Stacktrace:
[ObjectDisposedException: Channel has already been signaled to stop
Object name: 'Channel'.]
PushSharp.Common.PushChannelBase.QueueNotification(Notification notification, Boolean countsAsRequeue) in c:\Dropbox\GitHub\PushSharp\PushSharp.Common\PushChannelBase.cs:87
PushSharp.Apple.ApplePushChannel.SendNotification(Notification notification) in c:\Dropbox\GitHub\PushSharp\PushSharp.Apple\ApplePushChannel.cs:107
PushSharp.Common.PushChannelBase.Sender() in c:\Dropbox\GitHub\PushSharp\PushSharp.Common\PushChannelBase.cs:121
System.Threading.Tasks.Task.Execute() +130

[AggregateException: One or more errors occurred.]
System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken) +1738
System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout) +84
PushSharp.Common.<>c__DisplayClass5.b__4(PushChannelBase channel) in c:\Dropbox\GitHub\PushSharp\PushSharp.Common\PushServiceBase.cs:68
System.Threading.Tasks.<>c__DisplayClassf`1.b__c() +4399023
System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask) +24
System.Threading.Tasks.<>c__DisplayClass7.b__6(Object ) +406

[AggregateException: One or more errors occurred.]
System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) +5842467
System.Threading.Tasks.Task.Wait() +44
System.Threading.Tasks.Parallel.ForWorker(Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Func4 bodyWithLocal, Func1 localInit, Action1 localFinally) +5772041 System.Threading.Tasks.Parallel.ForEachWorker(IEnumerable1 source, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Action3 bodyWithStateAndIndex, Func4 bodyWithStateAndLocal, Func5 bodyWithEverything, Func1 localInit, Action1 localFinally) +524 System.Threading.Tasks.Parallel.ForEach(IEnumerable1 source, Action`1 body) +188
PushSharp.Common.PushServiceBase.Stop(Boolean waitForQueueToFinish) in c:\Dropbox\GitHub\PushSharp\PushSharp.Common\PushServiceBase.cs:71
System.Threading.Tasks.Task.Execute() +130

[AggregateException: One or more errors occurred.]
System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken) +1738
System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout) +84
System.Threading.Tasks.Task.WaitAll(Task[] tasks) +39
Vdb.GG.Toyota.EUNewsfeed.Webservice.NotificationManager.Dispose() in E:\Projects\TFS\Novado\ShortTerm\Toyota\EUNewsfeed\Webservice\NotificationManager.cs:40
Vdb.GG.Toyota.EUNewsfeed.Webservice.Notification.OnUnload(Object sender, EventArgs eventArgs) in E:\Projects\TFS\Novado\ShortTerm\Toyota\EUNewsfeed\Webservice\Notification.aspx.cs:27
System.Web.UI.Control.UnloadRecursive(Boolean dispose) +160
System.Web.UI.Page.UnloadRecursive(Boolean dispose) +24
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11426238
System.Web.UI.Page.ProcessRequest() +269
System.Web.UI.Page.ProcessRequest(HttpContext context) +167
ASP.notification_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\e6258f78\c6c584c\App_Web_4k12j52l.0.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +625
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270

In the NotificationManager Dispose method I call: pushService.StopAllServices(true);
When I remove this line, I no longer get the exception, but the message is not sent either.

If I don't call Dispose in my page unload handler, messages are also not sent.

What am I doing wrong?

kvnhck commented Sep 24, 2012

The reason was that my renewed apple certifcate wasn't updated to the IIS environment when I published my website.

Nevertheless, the exception handling in this case could be better!

Owner

Redth commented Sep 24, 2012

Interesting... Did you receive any ChannelException events?

kvnhck commented Sep 24, 2012

No only the "Channel has already been signaled to stop" exception
After I set (in VS) the Debug-Exceptions to thrown for CLR, I got an error message like "...SSPI..." (don't remember exactly), which had an inner exception "Certificate was revoked".
That's how I found out what the real problem was.

Owner

Redth commented Sep 24, 2012

Ok, i'll take a look and see why the exception isn't bubbling up further... I thought it used to.

@ghost ghost assigned Redth Sep 24, 2012

@Redth Redth closed this in 22f9542 Oct 5, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment