Skip to content

Commit

Permalink
allow more concurrent requests to docker engine
Browse files Browse the repository at this point in the history
  • Loading branch information
sflow committed Oct 7, 2019
1 parent ffbd5c0 commit 108e5f1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Linux/mod_docker.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ extern "C" {
} HSPDockerNameCount;

#define HSP_DOCKER_SOCK VARFS_STR "/run/docker.sock"
#define HSP_DOCKER_MAX_CONCURRENT 3
#define HSP_DOCKER_MAX_CONCURRENT 15
#define HSP_DOCKER_HTTP " HTTP/1.1\nHost: " HSP_DOCKER_SOCK "\n\n"
#define HSP_DOCKER_API "v1.24"
#define HSP_DOCKER_REQ_EVENTS "GET /" HSP_DOCKER_API "/events?filters={\"type\":[\"container\"]}" HSP_DOCKER_HTTP
Expand Down Expand Up @@ -1610,7 +1610,15 @@ extern "C" {

case HSPDOCKERREQ_CONTENT: {
int clen = req->chunkLength ?: req->contentLength;
assert(clen == UTSTRBUF_LEN(sock->ioline)); // assume no newlines in chunk
if(clen != UTSTRBUF_LEN(sock->ioline)) {
myLog(LOG_ERR, "ERROR req->chunkLength=%d req->contentLength=%d len(sock->ioline)=%d",
req->chunkLength,
req->contentLength,
UTSTRBUF_LEN(sock->ioline));
myLog(LOG_ERR, "request (seqno=%d)=<%s>", req->seqNo, UTSTRBUF_STR(req->request));
myLog(LOG_ERR, "sock->ioline content=<%s>", UTSTRBUF_STR(sock->ioline));
}
assert(clen == UTSTRBUF_LEN(sock->ioline)); // assume no newlines in chunk (failing here!)
if(req->eventFeed)
processDockerJSON(mod, req, sock->ioline);
else {
Expand Down

0 comments on commit 108e5f1

Please sign in to comment.