Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-2511

Connection cache sometimes returns closed connections

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Need more Info
    • Priority: High
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Promise type: files
    • Labels:
      None

      Description

      1st copy from: request a non-existing file:

      verbose: Server returned error: Request denied
      info: Can't stat file '/whatever' on '1.2.3.4' in files.copy_from promise
      

      2nd copy from: tries to reuse the connection, but the server has already closed it;

      verbose: FindIdle: found connection to '1.2.3.4' already open and ready.
      error: Connection unexpectedly closed (SSL_read): socket closed
      

      The proper solution would be for conn_cache.c to check if a connection has any pending errors, before returning it from the cache. To check that we can use:

      int error = 0;
      socklen_t len = sizeof (error);
      int retval = getsockopt (socket_fd, SOL_SOCKET, SO_ERROR, &error, &len);
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10038 jimis (Dimitrios Apostolou)
                Reporter:
                a10038 jimis (Dimitrios Apostolou)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Zendesk Support

                    Summary Panel