Topshelf Services not stopping gracefully

5,068 views
Skip to first unread message

Stephen Mc Gowan

unread,
Apr 21, 2011, 11:09:52 AM4/21/11
to topshelf...@googlegroups.com
Hey,

I've been having issues with services built with Topshelf. I've
included my code below to show exactly what I'm doing. I'm using
Topshelf 2.1.0.0, services built for .Net v 3.5 and deployed on
Windows Server 2008 R2

I've built a number of services that are all having the same problem
and I've tested the basic TownCrier example below and I see the same
issue. If I leave them running for a while (30 minutes from casual
observation) the services won't stop gracefully. The Trace.Writeline
statements at the end of my stop method are being executed, as I can
see them in my logs, but the service appear to hang after this. The
after a while I get the following error, and the service isn't
stopped.

"Windows could not stop the TownCrier service on Local Computer. The
service did not return and error. This could be an internal Windows
error or an internal service error. If the Problem persists, contact
your system administrator."

If I try to stop the service a second time, I get this error and the
service appears to be killed by the service manager in Windows.

"Windows could not stop the TownCrier service on Local Computer.

Error 1061: The service cannot accept control messages at this time."


I'm deploying the service with "Towncrier.exe install" and then
starting it in the Windows service manager. Any ideas? Is there a way
to turn on debugging information for Topshelf? I've included my code
below, my trace listener is just a TextWriterTraceListener configured
in a app.config file.

namespace testTopShelf
{
using System;
using System.IO;
using System.Timers;
using System.Diagnostics;
using Topshelf;
using Topshelf.Configuration;
using Topshelf.Configuration.Dsl;

internal class Program
{
static void Main(string[] args)
{
RunConfiguration cfg = RunnerConfigurator.New(x =>
{
x.ConfigureService<TownCrier>(s =>
{
s.Named("TownCrier");
s.HowToBuildService(name => new TownCrier());
s.WhenStarted(tc => tc.Start());
s.WhenStopped(tc => tc.Stop());
});
x.RunAsLocalSystem();
x.SetDescription("Towncrier");
x.SetDisplayName("Towncrier");
x.SetServiceName("Towncrier");
});

Runner.Host(cfg, args);
}
}

public class TownCrier
{

readonly Timer _timer;

public TownCrier()
{
Trace.WriteLine("Init");
_timer = new Timer(1000) {AutoReset = true};
_timer.Elapsed += (sender, eventArgs) => onTimer();
}

public void onTimer()
{
string time = DateTime.Now.ToString();
Console.WriteLine(time);
Trace.WriteLine(time);
}

public void Start()
{
Console.WriteLine("Starting");
Trace.WriteLine("Starting Service");
_timer.Start();
Trace.WriteLine("Started");
}

public void Stop()
{
Console.WriteLine("Stopping");
Trace.WriteLine("Stopping Service");
_timer.Stop();
Trace.WriteLine("Stopped");
}
}
}

--
Stephen Mc Gowan.

Hakeem Mohammed

unread,
Apr 21, 2011, 2:59:27 PM4/21/11
to topshelf...@googlegroups.com
This has been fixed with the latest release of TS, version 2.2.

Stephen Mc Gowan

unread,
Apr 22, 2011, 7:08:19 AM4/22/11
to topshelf...@googlegroups.com
Cheers,

I had tried with the latest version but I was having issues because
the code examples on the website were out of date. This was leading to
deprecated code warnings at compile time and the services not
installing properly.

Just tried it with the code examples that are in the source on GitHub
and that appears to be working fine.

Is there plans to update the website? The documentation and code
examples appear to be out of date and the "Topshelf Binaries" link off
the documentation page links to version 2.0.

-Steve

--
Stephen Mc Gowan.

Dru Sellers

unread,
May 2, 2011, 10:18:51 AM5/2/11
to topshelf...@googlegroups.com
Code sample updated: see http://topshelf-project.com/documentation/getting-started/
Downloads link is also now pointing to the github/downloads instead of a specific one.

Rob Gibbens

unread,
May 2, 2011, 2:30:24 PM5/2/11
to topshelf-discuss
What is/was the difference? What needed to be changed between 2.0 and
2.2? We're having the same issues.

On May 2, 10:18 am, Dru Sellers <d...@drusellers.com> wrote:
> Code sample updated: seehttp://topshelf-project.com/documentation/getting-started/
> Downloads link is also now pointing to the github/downloads instead of a
> specific one.
>
> On Fri, Apr 22, 2011 at 6:08 AM, Stephen Mc Gowan <mccl...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Cheers,
>
> > I had tried with the latest version but I was having issues because
> > the code examples on the website were out of date. This was leading to
> > deprecated code warnings at compile time and the services not
> > installing properly.
>
> > Just tried it with the code examples that are in the source on GitHub
> > and that appears to be working fine.
>
> > Is there plans to update the website? The documentation and code
> > examples appear to be out of date and the "Topshelf Binaries" link off
> > the documentation page links to version 2.0.
>
> > -Steve
>
> > On Thu, Apr 21, 2011 at 7:59 PM, Hakeem Mohammed <hakeemo...@gmail.com>
> > wrote:
> > > This has been fixed with the latest release of TS, version 2.2.
>
> > > On Thu, Apr 21, 2011 at 11:09 AM, Stephen Mc Gowan <mccl...@gmail.com>

Dru Sellers

unread,
May 2, 2011, 2:57:50 PM5/2/11
to topshelf...@googlegroups.com
Which issue are you having Rob.

-d

Rob Gibbens

unread,
May 2, 2011, 3:52:49 PM5/2/11
to topshelf-discuss
When I run "MyApp.exe install", the install doesn't work anymore. The
service simply starts in Console Mode.


When I press Ctrl-C, the service outputs...

INFO [ServiceCoordinator] - [Topshelf] After stopping services
complete
INFO [ConsoleRunHost] - [Topshelf] Stopped

But the service just hangs, doesn't stop.

Rob Gibbens

unread,
May 2, 2011, 3:53:21 PM5/2/11
to topshelf-discuss
And this problem appears to have started when we upgraded from 2.0 to
2.2.



On May 2, 2:57 pm, Dru Sellers <d...@drusellers.com> wrote:

Dru Sellers

unread,
May 2, 2011, 3:55:53 PM5/2/11
to topshelf...@googlegroups.com
Ok, cool beans. More info is better. :)

What does your config look like?

-d

Rob Gibbens

unread,
May 2, 2011, 4:02:17 PM5/2/11
to topshelf-discuss
var cfg = RunnerConfigurator.New(x =>
{
x.SetDisplayName("V.H.QueuePoller" + instanceName);
x.SetServiceName("V.H.QueuePoller" + instanceName);
x.SetDescription("Processing Service");

x.ConfigureService<IQueuePoller>(c =>
{
c.WhenStarted(s => s.Start());
c.WhenStopped(s => s.Stop());
c.WhenPaused(s => s.Stop());
c.WhenContinued(s => s.Start());
c.HowToBuildService(builder =>
Windsor.Container.Resolve<IQueuePoller>());
});
});

Runner.Host(cfg, args);

Rob Gibbens

unread,
May 2, 2011, 4:04:18 PM5/2/11
to topshelf-discuss
Also, we have nine different services/apps using TopShelf, and this
problem is now occurring in all of them after upgrading to 2.2. The
configs are all similar.

Rob Gibbens

unread,
May 2, 2011, 4:09:18 PM5/2/11
to topshelf-discuss
Ah...I now see that there is a HostFactory. I'll try switching to
that and see if it helps.

Rob Gibbens

unread,
May 2, 2011, 4:12:45 PM5/2/11
to topshelf-discuss
When using HostFactory, what's the equivalent of HowToBuildService?
ConstructUsing?

Dru Sellers

unread,
May 2, 2011, 4:16:33 PM5/2/11
to topshelf...@googlegroups.com
ConstructUsing correct

-d

Rob Gibbens

unread,
May 2, 2011, 4:18:48 PM5/2/11
to topshelf-discuss
That did it. So other people can follow along, I changed my
configuration from..

var cfg = RunnerConfigurator.New(x =>
{
x.SetDisplayName("V.H.QueuePoller" + instanceName);
x.SetServiceName("V.H.QueuePoller" + instanceName);
x.SetDescription("Processing Service");
x.ConfigureService<IQueuePoller>(c =>
{
c.WhenStarted(s => s.Start());
c.WhenStopped(s => s.Stop());
c.WhenPaused(s => s.Stop());
c.WhenContinued(s => s.Start());
c.HowToBuildService(builder =>
Windsor.Container.Resolve<IQueuePoller>());
});
});
Runner.Host(cfg, args);


To...

var h = HostFactory.New(x =>
{
x.Service<IQueuePoller>(c =>
{
c.WhenStarted(s => s.Start());
c.WhenStopped(s => s.Stop());
c.WhenPaused(s => s.Stop());
c.WhenContinued(s => s.Start());
c.ConstructUsing(builder =>
Windsor.Container.Resolve<IQueuePoller>());
});

x.SetDisplayName("V.H.QueuePoller" + instanceName);
x.SetServiceName("V.H.QueuePoller" + instanceName);
x.SetDescription("Processing Service");
});

h.Run();


and am able to install the service and stop the service again. Thanks
for the help.

On May 2, 4:16 pm, Dru Sellers <d...@drusellers.com> wrote:
> ConstructUsing correct
>
> -d
>

Rob Gibbens

unread,
May 2, 2011, 4:20:30 PM5/2/11
to topshelf-discuss
Actually, I can install now, but pressing Ctrl-C still leaves the
console app running (doesn't return to command prompt). Is this
expected?

INFO [QueuePoller] - QueuePoller Stopped: 5/2/2011 4:19:10 PM
INFO [IQueuePoller] - [IQueuePoller] Stop complete
INFO [ServiceCoordinator] - (IQueuePoller) Stopped
INFO [ServiceCoordinator] - (IQueuePoller) Unloading
INFO [IQueuePoller] - [IQueuePoller] Unload complete
INFO [ServiceCoordinator] - (IQueuePoller) Unloaded
INFO [ServiceCoordinator] - [Topshelf] After stopping services
complete
INFO [ConsoleRunHost] - [Topshelf] Stopped <--- HANGS HERE



On May 2, 4:16 pm, Dru Sellers <d...@drusellers.com> wrote:
> ConstructUsing correct
>
> -d
>

Rob Gibbens

unread,
May 2, 2011, 4:31:53 PM5/2/11
to topshelf-discuss
If the RunnerConfigurator no longer works, can it either be removed
completely, or fixed to be backwards compatible? Silently failing is
rather confusing.



On May 2, 4:16 pm, Dru Sellers <d...@drusellers.com> wrote:
> ConstructUsing correct
>
> -d
>

Travis Smith

unread,
May 2, 2011, 4:58:12 PM5/2/11
to topshelf...@googlegroups.com
CTRL+C fails with Visual Studio 2010, if I recall correctly. I think
Chris is working on a work around which involved another key combo.

I think RunnerConfigurator is still supported but if it's failing
obviously we messed something. Drop a bug in on github and we can
address it.

-Travis

Rob Gibbens

unread,
May 2, 2011, 9:06:42 PM5/2/11
to topshelf-discuss
Fails when debugging with VS2010, or fails for anything built with
VS2010? I'm running the console app/exe completely outside of VS/
Debugger.
> ...
>
> read more »

Dru Sellers

unread,
May 2, 2011, 11:54:58 PM5/2/11
to topshelf...@googlegroups.com
Can you shoot me steps to reproduce. I just tested it on 7 different services and all were good.

-d

Robert Gibbens

unread,
May 2, 2011, 11:53:30 PM5/2/11
to topshelf...@googlegroups.com
For the Ctrl-C issue only?

Rob Gibbens

unread,
May 2, 2011, 11:54:13 PM5/2/11
to topshelf-discuss
I'll see if I can extract it out from our code at work and send a
sample app.

On May 2, 11:53 pm, Robert Gibbens <robgibb...@gmail.com> wrote:
> For the Ctrl-C issue only?
>
>
>
>
>
>
>
> On Mon, May 2, 2011 at 11:54 PM, Dru Sellers <d...@drusellers.com> wrote:
> > Can you shoot me steps to reproduce. I just tested it on 7 different
> > services and all were good.
>
> > -d
>
> ...
>
> read more »

Dru Sellers

unread,
May 2, 2011, 11:55:40 PM5/2/11
to topshelf...@googlegroups.com
that would be awesome. thanks!
-d

Hakeem Mohammed

unread,
May 3, 2011, 9:05:30 AM5/3/11
to topshelf...@googlegroups.com
Ctrl + C does stop the service running in VS '10 command prompt. It does take a few seconds though. Our set up is similar to what Rob has posted, configured with the HostFactory. Thanks!

James Bradt

unread,
May 3, 2011, 11:37:03 AM5/3/11
to topshelf-discuss
I've experienced TS not being graceful on shutdown also.

I have various shelved service hosts running (each handling a variety
of services). Right now, these hosts are running in consoles.
(Later, they will be running as windows services)

If I leave the services running for a while (not sure how long), when
I Ctrl-C to shut down, the exception below occurs.

If I Ctrl-C shutdown shortly (within minutes) after starting the
service host, the exception does not occur.

Any suggestions?

Thanks,
James

========================


LOG:FATAL 2011-05-03 11:30:03 -
An unhandled exception occurred within the service:
MfgOrderTestRunner.exe
Stact.Workflow.StateMachineWorkflowException: CommunicationException
occurred while handling Stop during Running --->
System.ServiceModel.CommunicationException: There was an error writing
to the pipe: The pipe is being closed. (232, 0xe8). --->
System.IO.IOException: The write operation failed, see inner
exception. ---> System.ServiceModel.CommunicationException: There was
an error writing to the pipe: The pipe is being closed. (232, 0xe8).
---> System.IO.PipeException: There was an error writing to the pipe:
The pipe is being closed. (232, 0xe8).
at
System.ServiceModel.Channels.PipeConnection.StartSyncWrite(Byte[]
buffer, Int32 offset, Int32 size, Object& holder)
at System.ServiceModel.Channels.PipeConnection.WriteHelper(Byte[]
buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout,
Object& holder)
--- End of inner exception stack trace ---
at System.ServiceModel.Channels.PipeConnection.WriteHelper(Byte[]
buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout,
Object& holder)
at System.ServiceModel.Channels.PipeConnection.Write(Byte[] buffer,
Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)
at System.ServiceModel.Channels.BufferedConnection.WriteNow(Byte[]
buffer, Int32 offset, Int32 size, TimeSpan timeout, BufferManager
bufferManager)
at System.ServiceModel.Channels.BufferedConnection.Write(Byte[]
buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)
at System.ServiceModel.Channels.ConnectionStream.Write(Byte[]
buffer, Int32 offset, Int32 count)
at System.Net.Security.NegotiateStream.StartWriting(Byte[] buffer,
Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.NegotiateStream.ProcessWrite(Byte[] buffer,
Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
--- End of inner exception stack trace ---
at System.Net.Security.NegotiateStream.ProcessWrite(Byte[] buffer,
Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.NegotiateStream.Write(Byte[] buffer, Int32
offset, Int32 count)
at System.ServiceModel.Channels.StreamConnection.Write(Byte[]
buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)
--- End of inner exception stack trace ---

Server stack trace:
at System.ServiceModel.Channels.StreamConnection.Write(Byte[]
buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)
at System.ServiceModel.Channels.StreamConnection.Write(Byte[]
buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout,
BufferManager bufferManager)
at
System.ServiceModel.Channels.FramingDuplexSessionChannel.OnSend(Message
message, TimeSpan timeout)
at System.ServiceModel.Channels.OutputChannel.Send(Message message,
TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action,
Boolean oneway, ProxyOperationRuntime operation, Object[] ins,
Object[] outs, TimeSpan timeout)
at
System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage
methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage
message)

Exception rethrown at [0]:
at
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
at
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
at Stact.Internal.WcfChannel`1.Send(T message)
at Stact.BroadcastChannel.Send[T](T message) in d:\Home\Stact\src
\Stact\Channels\BroadcastChannel.cs:line 51
at Topshelf.Model.ShelfServiceController.Send[T](T message) in d:
\BuildAgent-01\work\8017284c2525f9be\src\Topshelf\Model
\ShelfServiceController.cs:line 171
at Stact.Workflow.Internal.ActivityList`1.Execute[TBody](TInstance
instance, TBody body) in d:\Home\Stact\src\Stact\Workflow\Internal
\ActivityList.cs:line 52
at Stact.Workflow.Internal.MessageActivityExecutor`2.Execute[T]
(TInstance instance, T bodyT) in d:\Home\Stact\src\Stact\Workflow
\Internal\MessageActivityExecutor.cs:line 73
--- End of inner exception stack trace ---
at Stact.Workflow.Internal.MessageActivityExecutor`2.Execute[T]
(TInstance instance, T bodyT) in d:\Home\Stact\src\Stact\Workflow
\Internal\MessageActivityExecutor.cs:line 81
at Stact.Workflow.Internal.ActivityList`1.Execute[TBody](TInstance
instance, TBody body) in d:\Home\Stact\src\Stact\Workflow\Internal
\ActivityList.cs:line 52
at Stact.Workflow.Internal.StateMachineState`1.RaiseEvent[TBody]
(TInstance instance, Event`1 eevent, TBody body) in d:\Home\Stact\src
\Stact\Workflow\Internal\StateMachineState.cs:line 84
at
Stact.Workflow.Internal.StateMachineWorkflowImpl`2.RaiseEvent[TBody]
(TInstance instance, Event`1 eevent, TBody body) in d:\Home\Stact\src
\Stact\Workflow\Internal\StateMachineWorkflowImpl.cs:line 87
at
Stact.Internal.StateMachineWorkflowEventBinder`3.<>c__DisplayClass2.<Bind>b__1(TBody
m) in d:\Home\Stact\src\Stact\Actors\Internal
\StateMachineWorkflowEventBinder.cs:line 76
at
Stact.Internal.PendingReceiveImpl`1.<>c__DisplayClass1.<Accept>b__0(TMessage
m) in d:\Home\Stact\src\Stact\Actors\Internal
\PendingReceiveImpl.cs:line 95
at Stact.Internal.OperationList.Run() in d:\Home\Stact\src\Stact
\Fibers\Internal\OperationList.cs:line 42
at Stact.Internal.BasicOperationExecutor.Execute(IList`1
operations) in d:\Home\Stact\src\Stact\Fibers\Internal
\BasicOperationExecutor.cs:line 34
at Stact.PoolFiber.Execute() in d:\Home\Stact\src\Stact\Fibers
\PoolFiber.cs:line 115
at System.Threading.ExecutionContext.runTryCode(Object userData)
at
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
ignoreSyncCtx)
at
System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Dru Sellers

unread,
May 3, 2011, 11:39:16 AM5/3/11
to topshelf...@googlegroups.com
Hi James,

What version of TS are you running on.
what does your configuration look like.
What version of .net are you running it on.

-d

James Bradt

unread,
May 3, 2011, 12:57:56 PM5/3/11
to topshelf-discuss
Sorry - forgot to add the extra info.

Let me know if you need more clarification.

Thanks,
James

=============================

dotnet 4
TS 2.2.1.0 - dl'd binary zip from github yesterday. I did not build
from sourcecode.

--------------------

I am using shelving. When debugging inside of VS2010, I send a
serviceChannel message directly to create an internal shelftype
(instead of using the DirectoryMonitor when deployed). I've seen this
exception in both situations (debug and deployed)

-------------------

I start the Hosting.DirectoryMonitor with

Dim message = New CreateShelfService("Hosting.DirectoryMonitor",
ShelfType.Internal, GetType(FileSystem.DirectoryMonitorBootstrapper))
_serviceChannel.Send(message)

------------------

the run method (bootstrapperHost is of type ServiceHost) is configured
as

HostFactory.Run(Sub(x)

x.BeforeStartingServices(Sub()

Console.WriteLine("[Host Bootstrapper] Preparing to start host
services")

_log.Info("[Host Bootstrapper] Preparing to start host services")
End Sub)

x.AfterStartingServices(Sub()

Console.WriteLine("[Host Bootstrapper] All services have been
started")

_log.Info("[Host Bootstrapper] All services have been started")
End Sub)


x.SetServiceName(bootstrapperHost.HostServiceName)

x.SetDisplayName(bootstrapperHost.HostServiceName)

x.SetDescription(bootstrapperHost.HostServiceDescription)

bootstrapperHost.RunAs(x)
'x.RunAsLocalSystem()

x.EnableDashboard()

x.Service(Of ServiceHost)(Sub(y)

y.SetServiceName(bootstrapperHost.HostServiceName)

y.ConstructUsing(Function(name, coordinator)

bootstrapperHost.SetServiceChannel(coordinator)

Return bootstrapperHost

End Function)

y.WhenStarted(Sub(host__1)

host__1.Start()

End Sub)

y.WhenStopped(Sub(host__1)

host__1.[Stop]()

End Sub)

End Sub)

x.AfterStoppingServices(Sub()

Console.WriteLine("[Host Bootstrapper] All services have been
stopped")

_log.Info("[Host Bootstrapper] All services have been stopped")

End Sub)

End Sub)

-------------------------

when using the directoryMonitor, each shelf is config'd by using a
config file

example:
<ShelfConfiguration Bootstrapper="MyService.ServiceBootstrapper,
MyService" />




Dru Sellers

unread,
May 3, 2011, 8:55:46 PM5/3/11
to topshelf...@googlegroups.com
ok. so to be clear. in 'prod' this is running as a shelf. you are not directly sending any messages correct?

-d

James Bradt

unread,
May 5, 2011, 8:57:14 AM5/5/11
to topshelf-discuss
Sorry for the delay in replying...

The only shelf that is being started via a message is the directory
monitor service.

Thanks,
James

Dru Sellers

unread,
May 5, 2011, 9:02:05 AM5/5/11
to topshelf...@googlegroups.com
no problem. Does this issue only occur when your service is running? Or does it happen with the host by itself?

-d

James Bradt

unread,
May 5, 2011, 11:11:20 AM5/5/11
to topshelf-discuss
The issue occurs whether any additional services are running.

The only base services are the TS directory Monitor and the TS
dashboard.

I started up the host as a console app and let is sit idle for a while
(approx 2 hours). I then pressed Ctrl-C and received the same
exceptions as reported above.

I will try the same with the shelving example to see if I can
reproduce it there.

James

James Bradt

unread,
May 6, 2011, 1:46:13 PM5/6/11
to topshelf-discuss
Today, I actually had time to let the TS host run.

I started "Topshelf.Host.exe" without any services available for
shelving at approx 9:30 am

I Ctrl-C'd the host at approx 1:30 pm.

An exception occurred and I've included the complete log for the host
below.

Let me know if you have any further questions.

Thanks,
James

=================================




INFO 2011-05-06 09:34:54 - Topshelf v2.2.1.0, .NET Framework
v4.0.30319.431
INFO 2011-05-06 09:34:54 - [Topshelf] Before starting services
complete
INFO 2011-05-06 09:34:55 - [TopshelfDashboard] Create complete
INFO 2011-05-06 09:34:55 - [Topshelf.Host] Create complete
INFO 2011-05-06 09:34:55 - (TopshelfDashboard) Created
INFO 2011-05-06 09:34:55 - (Topshelf.Host) Created
INFO 2011-05-06 09:34:55 - (Topshelf.Host) Starting
INFO 2011-05-06 09:34:55 - (TopshelfDashboard) Starting
INFO 2011-05-06 09:34:55 - [Topshelf.Host] Start complete
INFO 2011-05-06 09:34:55 - [Topshelf] Create Shelf Service:
TopShelf.DirectoryMonitor (DirectoryMonitorBootstrapper)
INFO 2011-05-06 09:34:55 - Loading dashboard at Uri:
http://localhost:8483/Topshelf/Topshelf.Host
INFO 2011-05-06 09:34:55 - [TopshelfDashboard] Start complete
INFO 2011-05-06 09:34:55 - (Topshelf.Host) Running
INFO 2011-05-06 09:34:55 - (TopshelfDashboard) Running
INFO 2011-05-06 09:34:55 - [Topshelf] After starting services
complete
INFO 2011-05-06 09:34:55 - [Topshelf] Running, press Control+C to
exit.
INFO 2011-05-06 09:34:55 - [TopShelf.DirectoryMonitor] Created Host
Channel: net.pipe://localhost/topshelf_4148/controller/
TopShelf.DirectoryMonitor(4148/TopShelf.DirectoryMonitor)
INFO 2011-05-06 09:34:56 - (TopShelf.DirectoryMonitor) ShelfCreated
INFO 2011-05-06 09:34:57 - (TopShelf.DirectoryMonitor) Created
INFO 2011-05-06 09:34:57 - (TopShelf.DirectoryMonitor) Running
INFO 2011-05-06 01:36:53 - Control+C detected, exiting.
INFO 2011-05-06 01:36:53 - [Topshelf] Stopping
INFO 2011-05-06 01:36:53 - (TopshelfDashboard) Stopping
INFO 2011-05-06 01:36:53 - [Topshelf.Host] Stop complete
INFO 2011-05-06 01:36:53 - (Topshelf.Host) Stopping
INFO 2011-05-06 01:36:53 - (Topshelf.Host) Stopped
INFO 2011-05-06 01:36:53 - [TopshelfDashboard] Stop complete
INFO 2011-05-06 01:36:53 - (TopshelfDashboard) Stopped
INFO 2011-05-06 01:36:53 - [TopshelfDashboard] Unload complete
INFO 2011-05-06 01:36:53 - (TopshelfDashboard) Unloading
INFO 2011-05-06 01:36:53 - (TopshelfDashboard) Unloaded
INFO 2011-05-06 01:36:53 - [Topshelf.Host] Unload complete
INFO 2011-05-06 01:36:53 - (Topshelf.Host) Unloading
INFO 2011-05-06 01:36:53 - (Topshelf.Host) Unloaded
FATAL 2011-05-06 01:36:54 - An unhandled exception occurred within the
service: Topshelf.Host.exe
at Topshelf.Model.ShelfServiceController.Send[T](T message) in c:
\Projects\_ThirdPartyLibrariesSources\Topshelf\src\Topshelf\Model
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
ignoreSyncCtx)
at
System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
INFO 2011-05-06 01:36:54 - (Topshelf.Host.exe) Fault
ERROR 2011-05-06 01:36:54 - Fault on Topshelf.Host.exe:
Topshelf.Exceptions.TopshelfException
An unhandled exception occurred within the service: Topshelf.Host.exe
CommunicationException occurred while handling Stop during Running
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
ignoreSyncCtx)
at
System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

HelpLink:


ERROR 2011-05-06 01:37:54 - [TopShelf.DirectoryMonitor] Failed to stop
ERROR 2011-05-06 01:37:54 - The service did not shut down gracefully
System.InvalidOperationException: All services were not Completed
within the specified timeout
at Topshelf.Model.ServiceCoordinator.WaitUntilAllServicesAre(State
state, TimeSpan timeout) in c:\Projects\_ThirdPartyLibrariesSources
\Topshelf\src\Topshelf\Model\ServiceCoordinator.cs:line 332
at Topshelf.Model.ServiceCoordinator.Stop() in c:\Projects
\_ThirdPartyLibrariesSources\Topshelf\src\Topshelf\Model
\ServiceCoordinator.cs:line 134
at Topshelf.Hosts.ConsoleRunHost.ShutdownCoordinator() in c:
\Projects\_ThirdPartyLibrariesSources\Topshelf\src\Topshelf\Hosts
\ConsoleRunHost.cs:line 83
INFO 2011-05-06 01:37:54 - [Topshelf] Stopped

Chris Patterson

unread,
May 6, 2011, 1:57:50 PM5/6/11
to topshelf...@googlegroups.com
Interesting, it seems that WCF is hanging up the connection after a period of time. I guess I'll dig into the WCF configuration and see if this is something configurable or if I just need to reconnect if an exception occurs... Hmmm.
Reply all
Reply to author
Forward
0 new messages