Bug fix in blobstore request loop where zero-content requests (i.e. not uploads) could cause mismatches between requests and responses. Added HTTPRequest debug event.
This commit is contained in:
parent
f05bb0eb9b
commit
339e15563e
|
@ -511,8 +511,8 @@ ACTOR Future<Reference<HTTP::Response>> doRequest_impl(Reference<BlobStoreEndpoi
|
|||
Future<BlobStoreEndpoint::ReusableConnection> frconn = bstore->connect();
|
||||
|
||||
// Make a shallow copy of the queue by calling addref() on each buffer in the chain and then prepending that chain to contentCopy
|
||||
contentCopy.discardAll();
|
||||
if(pContent != nullptr) {
|
||||
contentCopy.discardAll();
|
||||
PacketBuffer *pFirst = pContent->getUnsent();
|
||||
PacketBuffer *pLast = nullptr;
|
||||
for(PacketBuffer *p = pFirst; p != nullptr; p = p->nextPacketBuffer()) {
|
||||
|
|
|
@ -294,6 +294,8 @@ namespace HTTP {
|
|||
// and be destroyed by the caller
|
||||
// TODO: pSent is very hackish, do something better.
|
||||
ACTOR Future<Reference<HTTP::Response>> doRequest(Reference<IConnection> conn, std::string verb, std::string resource, HTTP::Headers headers, UnsentPacketQueue *pContent, int contentLen, Reference<IRateControl> sendRate, int64_t *pSent, Reference<IRateControl> recvRate) {
|
||||
state TraceEvent event(SevDebug, "HTTPRequest");
|
||||
|
||||
state UnsentPacketQueue empty;
|
||||
if(pContent == NULL)
|
||||
pContent = ∅
|
||||
|
@ -301,6 +303,12 @@ namespace HTTP {
|
|||
state bool earlyResponse = false;
|
||||
state int total_sent = 0;
|
||||
|
||||
event.detail("DebugID", conn->getDebugID());
|
||||
event.detail("RemoteAddress", conn->getPeerAddress());
|
||||
event.detail("Verb", verb);
|
||||
event.detail("Resource", resource);
|
||||
event.detail("RequestContentLen", contentLen);
|
||||
|
||||
try {
|
||||
// Write headers to a packet buffer chain
|
||||
PacketBuffer *pFirst = new PacketBuffer();
|
||||
|
@ -347,8 +355,11 @@ namespace HTTP {
|
|||
}
|
||||
|
||||
Void _ = wait(responseReading);
|
||||
event.detail("ResponseCode", r->code);
|
||||
event.detail("ResponseContentLen", r->contentLen);
|
||||
|
||||
double elapsed = timer() - send_start;
|
||||
event.detail("Elapsed", elapsed);
|
||||
if(CLIENT_KNOBS->HTTP_VERBOSE_LEVEL > 0)
|
||||
printf("[%s] HTTP code=%d early=%d, time=%fs %s %s contentLen=%d [%d out, response content len %d]\n",
|
||||
conn->getDebugID().toString().c_str(), r->code, earlyResponse, elapsed, verb.c_str(), resource.c_str(), contentLen, total_sent, (int)r->contentLen);
|
||||
|
|
Loading…
Reference in New Issue