Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-27396

Fix a problem with the socket reuse option in QHTTP when running the server inside Docker environment

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: To Do
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: Qserv
    • Labels:
      None

      Description

      The current implementation of the embedded HTTP server qhttp for C++ seems to have a problem with reusing sockets. This is happening if the server is run inside the Docker container while its clients are running outside the container. In this case, clients begin losing connections with the server a few seconds after sending many short requests to the server. This can be demonstrated with a single client sending requests sequentially. If clients are run inside the same container the connection losses are not happening.

      The problem has been narrowed down to the following code:

      173: void Server::_readRequest(std::shared_ptr<ip::tcp::socket> socket)
      174: {
      ...
      208:       if (request->version == "HTTP/1.1") {
      209:            *reuseSocket = true;
      210:       }
      ...
      

      Disabling this option fixes the problem.

        Attachments

          Issue Links

            Activity

            There are no comments yet on this issue.

              People

              Assignee:
              fritzm Fritz Mueller
              Reporter:
              gapon Igor Gaponenko
              Reviewers:
              Igor Gaponenko
              Watchers:
              Fritz Mueller, Igor Gaponenko, Nate Pease
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: