Uploaded image for project: 'OpenDJ'
  1. OpenDJ
  2. OPENDJ-7896

HTTP connection logs some operation failures to the error logger not access logger

    XMLWordPrintable

    Details

    • Bug
    • Status: Dev backlog
    • Major
    • Resolution: Unresolved
    • 7.0.0
    • None
    • logging, rest
    • None

      Description

      Reference: https://ds-jenkins.live.gcp.forgerock.net/job/ds-build/job/master/70//artifact/log-ft-part2-linux.html#s1-s5-s2-t1

      Test suite: external_monitoring_group.PrometheusWithDJAndGrafana

      Error log:

      [24/Mar/2021:19:31:35 +0000] category=PROTOCOL severity=ERROR msgID=1544 msg=Unable to execute command: Unavailable: The request to process this operation has been rejected because the Directory Server has already started its shutdown process
      

      Firstly, the error message is very misleading when it talks about "executing a command". It's actually trying to submit an HTTP operation to the work queue, but the server is in the process of shutting down, so the work queue rejects the operation. For LDAP we trap this problem and fail the operation and then log something in the access log, not the error log.

      Buggy code is in HTTPConnectionHandler.ExecuteInWorkerThread:

          private static final class ExecuteInWorkerThread extends AbstractExecutorService {
              private final ServerContext serverContext;
      
              private ExecuteInWorkerThread(ServerContext serverContext) {
                  this.serverContext = serverContext;
              }
      
              @Override
              public void execute(final Runnable command) {
                  try {
                      serverContext.getWorkQueue().submitOperation(new AsyncOperation(getRootConnection(), command));
                  } catch (final LdapException e) {
                      logger.error(ERR_HTTP_COMMAND_EXECUTION_EXCEPTION, getExceptionMessage(e));
                  }
              }
      

      The LdapException should be trapped and trigger the operation to fail. We should not log it in the error logger.

        Attachments

          Activity

            People

            Unassigned Unassigned
            matthew Matthew Swift
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated: