Folder watcher application disappears after running several days
-
The application watches a folder, and moves the files to another directory, and records some info in an SQL database. The app sometimes just disappears. It's not a complicated app. I checked to make sure I close all file handles, SQL connections, etc. Any idea on how to find out what's going on?
-
The application watches a folder, and moves the files to another directory, and records some info in an SQL database. The app sometimes just disappears. It's not a complicated app. I checked to make sure I close all file handles, SQL connections, etc. Any idea on how to find out what's going on?
If it was a scheduled task, then the final exit code would be available in the scheduled task window.
-
The application watches a folder, and moves the files to another directory, and records some info in an SQL database. The app sometimes just disappears. It's not a complicated app. I checked to make sure I close all file handles, SQL connections, etc. Any idea on how to find out what's going on?
Instrument your code so it logs information to a file. That way you can get an idea of what your service was doing when it crashed. Another possibility would be to run a Debug version of your server, then connect Visual Studio to the running instance to so you grab any exceptions that are thrown and you can see what variables are holding which values to get an idea of what the code was thinking when it blew up.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
If it was a scheduled task, then the final exit code would be available in the scheduled task window.
-
Is there a way one can start a program, then stop it (say at midnight), and restart it again?
dBrong wrote:
restart it again?
as in: let's not debug and figure out what is wrong, let's just close our eyes? what you need to do is: 1. add logging code, so a file tells you what is going on. Make sure to use File.AppendAllText so the file is likely closed when things go wrong. 2. try to increase activity so the problem occurs sooner, saving you some calendar time in locating and fixing the problem and testing the fix. :)
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
-
Is there a way one can start a program, then stop it (say at midnight), and restart it again?
What about making the task self submit itself to the task scheduler at midnight, then exit ? I agree that finding the root cause of the shutdown is the best way, but sometimes you will spend more time than is worth it. Create a detailed log of what the application is doing is highly recommended and if you have time is the best way to go. However, you may be trying to debug this application for months without finding the root cause. A self-submitting application seems like a straight forward approach and may give you years of trouble free execution. It's just a suggestion. Let's not get into nasty postings that don't help the situation. Respectfully, David
-
What about making the task self submit itself to the task scheduler at midnight, then exit ? I agree that finding the root cause of the shutdown is the best way, but sometimes you will spend more time than is worth it. Create a detailed log of what the application is doing is highly recommended and if you have time is the best way to go. However, you may be trying to debug this application for months without finding the root cause. A self-submitting application seems like a straight forward approach and may give you years of trouble free execution. It's just a suggestion. Let's not get into nasty postings that don't help the situation. Respectfully, David
-
The application watches a folder, and moves the files to another directory, and records some info in an SQL database. The app sometimes just disappears. It's not a complicated app. I checked to make sure I close all file handles, SQL connections, etc. Any idea on how to find out what's going on?
I seem to recall that the folder watcher was unstable, I looked into using it some years ago and it was known issue if there were too many envents on the folder the watcher would crash. We declined to use it at that point, however that was over 4 years ago. Instead we just used a timed read of the folder contents and processed anyhing we found. As we can process over 1200 filed in the hour FW was not an option - system has been stable for 4 years!
Never underestimate the power of human stupidity RAH
-
I seem to recall that the folder watcher was unstable, I looked into using it some years ago and it was known issue if there were too many envents on the folder the watcher would crash. We declined to use it at that point, however that was over 4 years ago. Instead we just used a timed read of the folder contents and processed anyhing we found. As we can process over 1200 filed in the hour FW was not an option - system has been stable for 4 years!
Never underestimate the power of human stupidity RAH
-
The application watches a folder, and moves the files to another directory, and records some info in an SQL database. The app sometimes just disappears. It's not a complicated app. I checked to make sure I close all file handles, SQL connections, etc. Any idea on how to find out what's going on?
Can the application be retasked as a service? The service can be set to auto-restart on failure. Just a thought... Tim
-
Can the application be retasked as a service? The service can be set to auto-restart on failure. Just a thought... Tim