I've been working with Windows Workflow Foundation recently and came across a weird exception that was reported by one of my colleagues. It turns out that if create a Delay Activity with a timeout value that exceeds 2^32-2 milliseconds, you will generate an exception. This ends up being about 46 days (49.7 exactly, I believe.)
When the issue was reported, I couldn't reproduce it with my test harness. So I set out to search the Internet for more information. Unfortunately, it seems that Windows Workflow Foundation is not widely used (yet?) making the task a bit more difficult. With a few choice Google queries, I was eventually able to come across the issue as reported to Microsoft
here.
There's apparently a bug in the Thread Timer that results in this limitation. The exception is:
System.ArgumentOutOfRangeException: Time-out interval must be less than 2^32-2.
Once I confirmed that this was actually an issue, I set out to, again, search the internet for a fix. I came across a few articles that mention that the issue was repaired in the .Net 3.5 Fx, but I couldn't tell a client, who's in production, to update their entire framework.
I decided to setup a sandbox and try to reproduce the issue in my local environment and was still unable. The good news is that I was running 3.0, so something in my environment had fixed the issue. After an hour or so, I realized that I was assuming the the issue was reported from an environment with the latest service packs (silly me.) Once I removed that assumuption, along with 3.0 SP1 from my environment, I could reproduce the issue.
Once I was able to reproduce the issue, then reinstall SP1 to see the issue was fixed, I could confidently report that this issue was fixed in .Net 3.0 SP1 and the client needn't upgrade to 3.5; they just needed to install the service pack.
I decided to write this up in case anyone else came across the issue. When you're dealing with an expensive, deployed product, you have to be able to justify any changes to the software stack. And, since Microsoft does have
any change log or fix history for their service pack (beyond a simple "hey we fixed some issues with Workflow), I thought it'd be helpful to someone else in a locked down environment to have third-party confirmation that SP1 is all that's needed.
Also, I find it interesting that Microsoft's Workflow team didn't set any delay activities with large timeouts prior to releasing the framework. Never assume anything..