MCPcopy Create free account
hub / github.com/apache/mesos / fail

Method fail

3rdparty/libprocess/src/http.cpp:605–629  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

603
604
605bool Pipe::Writer::fail(const string& message)
606{
607 bool failed = false;
608 queue<Owned<Promise<string>>> reads;
609
610 synchronized (data->lock) {
611 if (data->writeEnd == Writer::OPEN) {
612 // Extract all the pending reads so we can fail them.
613 std::swap(data->reads, reads);
614
615 data->writeEnd = Writer::FAILED;
616 data->failure = Failure(message);
617 failed = true;
618 }
619 }
620
621 // NOTE: We set the promises outside the critical section to avoid
622 // triggering callbacks that try to reacquire the lock.
623 while (!reads.empty()) {
624 reads.front()->fail(message);
625 reads.pop();
626 }
627
628 return failed;
629}
630
631
632Future<Nothing> Pipe::Writer::readerClosed() const

Callers 15

statusFunction · 0.45
cmdlineFunction · 0.45
cpusFunction · 0.45
numifyFunction · 0.45
cleanupFunction · 0.45
closeMethod · 0.45
encodeFunction · 0.45
disconnectMethod · 0.45
_readMethod · 0.45
serveFunction · 0.45
decodeMethod · 0.45

Calls 3

FailureClass · 0.85
synchronizedFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected