summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2017-01-05 15:44:10 +0100
committerBenoit Foucher <benoit@zeroc.com>2017-01-05 15:44:10 +0100
commit12631cf162560150b056bb6565d87d8bb58fa2e8 (patch)
tree804ab8f6bf5900ee5f8a3971ccf8bbf0bda77c07
parentBumped ACM timeout (diff)
downloadice-12631cf162560150b056bb6565d87d8bb58fa2e8.tar.bz2
ice-12631cf162560150b056bb6565d87d8bb58fa2e8.tar.xz
ice-12631cf162560150b056bb6565d87d8bb58fa2e8.zip
Fixed ICE-7419 - spurious error message from kqueue selector
-rw-r--r--CHANGELOG-3.6.md11
-rw-r--r--cpp/src/Ice/Selector.cpp24
2 files changed, 33 insertions, 2 deletions
diff --git a/CHANGELOG-3.6.md b/CHANGELOG-3.6.md
index 4bc2b354632..5624bf6b167 100644
--- a/CHANGELOG-3.6.md
+++ b/CHANGELOG-3.6.md
@@ -8,6 +8,9 @@ We recommend that you use the release notes as a guide for migrating your
applications to this release, and the manual for complete details on a
particular aspect of Ice.
+- [Changes in Ice 3.6.4](#changes-in-ice-364)
+ - [General Changes](#general-changes)
+ - [C++ Changes](#c-changes)
- [Changes in Ice 3.6.3](#changes-in-ice-363)
- [General Changes](#general-changes)
- [C++ Changes](#c-changes)
@@ -48,9 +51,15 @@ These are the changes since Ice 3.6.4.
Andreas Sommer for the bug report and fix.
- Fixed a bug in Slice compilers which generates bogus dependencies when the
- Slice files are located in a directory that contains the string ".ice" in
+ Slice files are located in a directory that contains the string ".ice" in
the path.
+## C++ Changes
+
+- Fixed a spurious and harmless error message related to the kqueue selector.
+ This message would only show up under certain circumstances when using Ice
+ on macOS Sierra (10.2).
+
## JavaScript Changes
- Fixed a bug in Ice.Long toNumber implementation where negative integers
diff --git a/cpp/src/Ice/Selector.cpp b/cpp/src/Ice/Selector.cpp
index af568dccac7..b60669446d8 100644
--- a/cpp/src/Ice/Selector.cpp
+++ b/cpp/src/Ice/Selector.cpp
@@ -22,6 +22,13 @@
using namespace std;
using namespace IceInternal;
+#if defined(ICE_USE_KQUEUE)
+namespace
+{
+struct timespec zeroTimeout = { 0, 0 };
+}
+#endif
+
#ifdef ICE_OS_WINRT
using namespace Windows::Foundation;
using namespace Windows::Storage::Streams;
@@ -450,12 +457,27 @@ Selector::finish(EventHandler* handler, bool closeNow)
void
Selector::updateSelector()
{
- int rs = kevent(_queueFd, &_changes[0], _changes.size(), 0, 0, 0);
+ int rs = kevent(_queueFd, &_changes[0], _changes.size(), &_changes[0], _changes.size(), &zeroTimeout);
if(rs < 0)
{
Ice::Error out(_instance->initializationData().logger);
out << "error while updating selector:\n" << IceUtilInternal::errorToString(IceInternal::getSocketErrno());
}
+ else
+ {
+ for(int i = 0; i < rs; ++i)
+ {
+ //
+ // Check for errors, we ignore EINPROGRESS that started showing up with macOS Sierra
+ // and which occurs when another thread removes the FD from the kqueue (see ICE-7419).
+ //
+ if(_changes[i].flags & EV_ERROR && _changes[i].data != EINPROGRESS)
+ {
+ Ice::Error out(_instance->initializationData().logger);
+ out << "error while updating selector:\n" << IceUtilInternal::errorToString(_changes[i].data);
+ }
+ }
+ }
_changes.clear();
}
#endif