Delay problem with System Threading Timer

G

Guest

Hi all

Every week, I need to get two files on a remote server.
I have developped a C# Windows Service with two System.Threading.Timer to do this task

For the first one, the delay (TimeSpan dueTime) is always set to 6 days, 23 hours, 59 minutes, ..

Some weeks ?!?, the timer restarts immediately after its execution (and loop indefinitely). I have made a lot of tests and this issue does not occur with a delay < 1 day ..

Any suggestion

Thanks
Emmanue
 
U

Uri Dor

maybe the timer creation fails? I think you can only create a limited
number of them.
 
G

Guest

Was there any resolution to this issue?

I have a windows service that schedules various tasks using the System.Threading.Timer class. On some rare occasions after waiting the appropriate amount of time to fire, the timer continues to fire rapidly. I haven't been able to reproduce this behaviour, but I have had numerous customers report it. Customers first reported that a task scheduled every 28 days had ran when it was scheduled, but then continued to run again and again almost every second. At first I thought this was only affecting tasks with a very long interval, but since then it has happened with tasks scheduled every 6 hours and every 24 hours.

As a side note I had originally been using System.Timers.Timer, but switched to System.Threading.Timer due to a confirmed bug (KB 842793) that can cause a System.Timers.Timer to stop firing. It appears System.Threading.Timer may have a bug too, only instead of not firing it fires too much!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top