MCPcopy Create free account
hub / github.com/apache/brpc / ProcessThriftFramedRequestNoExcept

Function ProcessThriftFramedRequestNoExcept

src/brpc/policy/thrift_protocol.cpp:400–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398}
399
400inline void ProcessThriftFramedRequestNoExcept(ThriftService* service, Controller* cntl,
401 ThriftFramedMessage* req, ThriftFramedMessage* res,
402 ThriftClosure* done) {
403 // NOTE: done is not actually run before ResumeRunning() is called so that
404 // we can still set `cntl' in the catch branch.
405 done->SuspendRunning();
406 try {
407 service->ProcessThriftFramedRequest(cntl, req, res, done);
408 } catch (std::exception& e) {
409 cntl->SetFailed(EINTERNAL, "Catched exception: %s", e.what());
410 } catch (std::string& e) {
411 cntl->SetFailed(EINTERNAL, "Catched std::string: %s", e.c_str());
412 } catch (const char* e) {
413 cntl->SetFailed(EINTERNAL, "Catched const char*: %s", e);
414 } catch (...) {
415 cntl->SetFailed(EINTERNAL, "Catched unknown exception");
416 }
417 done->ResumeRunning();
418}
419
420namespace {
421struct CallMethodInBackupThreadArgs {

Callers 2

CallMethodInBackupThreadFunction · 0.85
ProcessThriftRequestFunction · 0.85

Calls 6

SuspendRunningMethod · 0.80
ResumeRunningMethod · 0.80
SetFailedMethod · 0.45
whatMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected