Hi,
the problem disappears if you define __FreeBSD__ in TSocket.cpp and change
virtual bool peek() {
/* shigin: see THRIFT-96 discussion */
if (rBase_ == rBound_) {
setReadBuffer(rBuf_.get(), transport_->read(rBuf_.get(), rBufSize_));
}
return (rBound_ > rBase_);
}
to
virtual bool peek() {
return (rBound_ > rBase_ || transport_->peek());
}
in TBufferTransports.h
I don't know if this really fixes the issue or just hides it and I don't know
if I break anything by making this change as I don't fully understand the code.
I guess that MacOS's recv() implementation issues ECONNRESET the second time it
is called on a closed socket.
I'm going to test that.
Patrick