Uploaded image for project: 'mod-audit'
  1. mod-audit
  2. MODAUD-35

Double http responses caused "Response head already sent" and db connection leak

    XMLWordPrintable

Details

    • Firebird Sprint 101
    • 1
    • Firebird
    • Q3 2020 Bug Fix

    Description

      Overview:
      Please take a look https://github.com/folio-org/mod-audit/blob/v1.0.0/mod-audit-server/src/main/java/org/folio/rest/impl/AuditHandlersService.java#L41-L47

      This caused tons of error in Bugfest log. See below for an example. The worst part is that after that, the db connection was leaked and database ran out of connections. See the attached screenshot about db connection leak.

      2020-10-23T09:52:58.125-04:00	java.lang.IllegalStateException: Response head already sent
      	2020-10-23T09:52:58.125-04:00	at io.vertx.core.http.impl.HttpServerResponseImpl.checkHeadWritten(HttpServerResponseImpl.java:638) ~[ms.jar:?]
      	2020-10-23T09:52:58.125-04:00	at io.vertx.core.http.impl.HttpServerResponseImpl.setStatusCode(HttpServerResponseImpl.java:132) ~[ms.jar:?]
      	2020-10-23T09:52:58.125-04:00	at org.folio.rest.RestVerticle.sendResponse(RestVerticle.java:770) ~[ms.jar:?]
      	2020-10-23T09:52:58.125-04:00	at org.folio.rest.RestVerticle.lambda$9(RestVerticle.java:512) ~[ms.jar:?]
      	2020-10-23T09:52:58.125-04:00	at org.folio.rest.impl.AuditHandlersService.lambda$0(AuditHandlersService.java:41) ~[ms.jar:?]
      	2020-10-23T09:52:58.125-04:00	at org.folio.rest.persist.PostgresClient.lambda$7(PostgresClient.java:725) ~[ms.jar:?]
      	2020-10-23T09:52:58.125-04:00	at org.folio.rest.persist.PostgresClient.lambda$21(PostgresClient.java:1112) ~[ms.jar:?]
      

      TestRail: Results

        Attachments

          1. db-conn-after-restart.png
            114 kB
            Hongwei Ji
          2. db-connection.png
            132 kB
            Hongwei Ji
          3. screenshot-1.png
            80 kB
            Martin Tran

          Issue Links

            Activity

              People

                khandramai Viachaslau Khandramai
                hji Hongwei Ji
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases