O
Ollie Riches
I'm looking into a production issue related to a windows service and
System.Timers.Timer. The background is the windows service uses a
System.Timers.Timer to periodically poll a directory location on a
network for files and then copies these files to another location (on
the network) AND then updates a record in the database. The file
copying is performed before the database update because the file
system is not transactional.
The code C# .Net (2.0) has the required try/catch/finally to capture
any exception that might be generated during the Timer Elapsed event -
any errors that are generated are logged. I also know about the issue
relating to System.Timers.Timer swallowing unhandled exceptions. The
code also logic (locks) to prevent to Timer Elapsed event being
processed at the same time, the files are processed in a synchronous
manner.
The issue that is arising is intermittently files are being copied BUT
the database record is not being updated as expected AND there is no
error message in our logs. As I said this is an intermittent fault
that I can't reproduce on the development server even when I chuck a
large number of files (large file size as well) at it.
I want to know has anyone had any similar experiences.
Next step is to investigate the hardware & software configuration of
the production server.
Cheers
Ollie Riches
System.Timers.Timer. The background is the windows service uses a
System.Timers.Timer to periodically poll a directory location on a
network for files and then copies these files to another location (on
the network) AND then updates a record in the database. The file
copying is performed before the database update because the file
system is not transactional.
The code C# .Net (2.0) has the required try/catch/finally to capture
any exception that might be generated during the Timer Elapsed event -
any errors that are generated are logged. I also know about the issue
relating to System.Timers.Timer swallowing unhandled exceptions. The
code also logic (locks) to prevent to Timer Elapsed event being
processed at the same time, the files are processed in a synchronous
manner.
The issue that is arising is intermittently files are being copied BUT
the database record is not being updated as expected AND there is no
error message in our logs. As I said this is an intermittent fault
that I can't reproduce on the development server even when I chuck a
large number of files (large file size as well) at it.
I want to know has anyone had any similar experiences.
Next step is to investigate the hardware & software configuration of
the production server.
Cheers
Ollie Riches