Pregunta

I have developed a Windows Service which watches a directory and upon arrival of specific files, it sends out emails to users using SMTP.

The service has been in production for some time now. These days, occasionally the users complain that they have not recieved the mails for the daily workflow. The problem gets resolved after restarting the service.

The service log does not show any instance of error. My take is that the service gets Hung / unresponsive. Is there any way to identify when the service gets Hung or get notified about the same? I mean, can this be handled as an exception ?

Also, what could be the possible reasons which may cause the service to hang?

EDIT1 Alternately, could the issue be caused due to File Watcher? Is it possible that the file watcher might have stopped running or become unresponsive? If so, are there any ways of simulating an unresponsive File watcher ?

EDIT2 The issue has been identified. The problem is with File Watcher. Apparently, the directory the watcher is looking over somehow becomes inaccessible, possibly due to network glitches. Now, if the directory is inaccessible, the FileWatcher gets confused and looses its way, thereby causing the service to become unresponsive.

¿Fue útil?

Solución

The issue has been identified. The problem is with File Watcher. Apparently, the directory the watcher is looking over somehow becomes inaccessible, possibly due to network glitches. Now, if the directory is inaccessible, the FileWatcher gets confused and looses its way, thereby causing the service to become unresponsive. Thanks for looking into it anyways.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top