Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
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 ***