By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,190 Members | 772 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,190 IT Pros & Developers. It's quick & easy.

Delay problem with System Threading Timer

P: n/a
ELO
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
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
maybe the timer creation fails? I think you can only create a limited
number of them.

ELO wrote:
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,
Emmanuel

Nov 16 '05 #2

P: n/a
maybe the timer creation fails? I think you can only create a limited
number of them.

ELO wrote:
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,
Emmanuel

Nov 16 '05 #3

P: n/a
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!

"ELO" wrote:
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,
Emmanuel

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.