diff options
author | Benoit Foucher <benoit@zeroc.com> | 2017-07-13 15:14:39 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2017-07-13 15:14:39 +0200 |
commit | 2178cc1d451e649356026ef375629ef5caca55d4 (patch) | |
tree | 06147e6a2892267ee133402a0579ff14d008950c | |
parent | Update UWP test projects to use additional options (diff) | |
download | ice-2178cc1d451e649356026ef375629ef5caca55d4.tar.bz2 ice-2178cc1d451e649356026ef375629ef5caca55d4.tar.xz ice-2178cc1d451e649356026ef375629ef5caca55d4.zip |
Fix for ICE-8309 - check for spurious selector wakeups
-rw-r--r-- | cpp/src/Ice/Selector.cpp | 11 | ||||
-rw-r--r-- | scripts/Util.py | 6 |
2 files changed, 14 insertions, 3 deletions
diff --git a/cpp/src/Ice/Selector.cpp b/cpp/src/Ice/Selector.cpp index ebffee5325e..8c0a4eed0c9 100644 --- a/cpp/src/Ice/Selector.cpp +++ b/cpp/src/Ice/Selector.cpp @@ -711,6 +711,7 @@ Selector::select(int timeout) timeout = -1; } + int spuriousWakeup = 0; while(true) { #if defined(ICE_USE_EPOLL) @@ -759,6 +760,16 @@ Selector::select(int timeout) out << "selector failed:\n" << ex; IceUtil::ThreadControl::sleep(IceUtil::Time::seconds(5)); // Sleep 5s to avoid looping } + else if(_count == 0 && timeout < 0 && ++spuriousWakeup < 100) + { + if(spuriousWakeup == 1) + { + Ice::Warning out(_instance->initializationData().logger); + out << "spurious selector wakeup"; + } + IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(1)); + continue; + } break; } diff --git a/scripts/Util.py b/scripts/Util.py index 636c4a60a48..e2137a8116b 100644 --- a/scripts/Util.py +++ b/scripts/Util.py @@ -1147,8 +1147,8 @@ class Process(Runnable): current.write(self.getOutput(current), stdout=False) def teardown(self, current, success): - assert self in current.processes - current.processes[self].teardown(current, success) + if self in current.processes: + current.processes[self].teardown(current, success) def expect(self, current, pattern, timeout=60): assert(self in current.processes and isinstance(current.processes[self], Expect.Expect)) @@ -1774,7 +1774,7 @@ class LocalProcessController(ProcessController): def teardown(self, current, success): if self.traceFile: - if success: + if success or current.driver.isInterrupted(): os.remove(self.traceFile) else: current.writeln("saved {0}".format(self.traceFile)) |