mordor
mordor copied to clipboard
calling Mordor::BaseRequestBroker::request with a bodyDg provided from a native thread segfaults
request() assumes it is being called from a fiber, which is not necessarily the case.
Future<> future;
boost::exception_ptr exception;
bool exceptionWasHttp = false;
if (bodyDg)
Scheduler::getThis()->schedule(boost::bind(&doBody,
request, bodyDg, boost::ref(future), boost::ref(exception),
boost::ref(exceptionWasHttp)));
the last line segfaults, since getThis() returns NULL
Are you ok with non-simultaneous reading and writing of the request and response? In practice this means a server that sends an error response and then hangs up before reading the full request would cause your client to only receive the write error, and not the actual response.
On Jul 6, 2012, at 6:40 PM, JT [email protected] wrote:
request() assumes it is being called from a fiber, which is not necessarily the case.
Future<> future; boost::exception_ptr exception; bool exceptionWasHttp = false; if (bodyDg) Scheduler::getThis()->schedule(boost::bind(&doBody, request, bodyDg, boost::ref(future), boost::ref(exception), boost::ref(exceptionWasHttp)));
the last line segfaults, since getThis() returns NULL
Reply to this email directly or view it on GitHub: https://github.com/ccutrer/mordor/issues/14
That sounds like an appropriate tradeoff. That's obviously lighter weight than doing something like spinning up a throwaway thread for doing them synchronously and covers almost all of the use cases. If you want something else set up a scheduler.
Yeah I'm cool with that.
hmm, how hard would it be to get the network/http library tests running both with a scheduler and with no scheduler? i fixed this issue only to find a few more places where an iomanager is assumed (Socket::cancelIo for example)