Created attachment 16538 [details]
We found that the AutoReset.WaitOne(timeoutInMs) is exiting prematurely in our code with 4.4.1 and not blocking for the entire timeout duration.
We are running mono version:
Mono JIT compiler version 4.4.1 (Nightly 22.214.171.124/4747417 Thu Jun 30 06:24:08 PDT 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
LLVM: supported, not enabled.
Using IronPython, below is a test script that exhibits the problem. Notice that the first call to Timeout(2) blocks for 2min. But the second call Timeout(30), which should block for 30 min, only blocks for 1min 22sec.
>>> import System
>>> import System.Threading
>>> from System.Threading import *
>>> from System import DateTime
>>> def Timeout(numMinutes):
... event = AutoResetEvent(False)
... start = DateTime.Now
... print "Waiting..." + start.ToString()
... event.WaitOne(numMinutes * 60 * 1000)
... finished = DateTime.Now
... diff = finished - start
... print "Finished at: " + finished.ToString() + " Elapsed: " + diff.ToString()
Waiting...6/30/2016 8:36:39 AM
Finished at: 6/30/2016 8:38:39 AM Elapsed: 00:02:00.0011030
Waiting...6/30/2016 8:39:41 AM
Finished at: 6/30/2016 8:41:03 AM Elapsed: 00:01:22.0137040
We also reproduced the problem on 126.96.36.199 today, btw.
Problem does not occur on 188.8.131.52 which is what we're running on regularly now. I don't believe i've seen it when testing against 184.108.40.2067 though I'm not 100% sure of that.
This is the same as https://bugzilla.xamarin.com/show_bug.cgi?id=41701 - no need for duplicate.
*** This bug has been marked as a duplicate of bug 42688 ***