Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4676

Avatica client leaks TCP connections

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • avatica-1.18.0
    • avatica-1.19.0
    • avatica
    • None

    Description

      The default Http client implmentation uses org.apache.http.impl.conn.PoolingHttpClientConnectionManager to pool connections, and does not close the TCP connections explicitly when the JDBC connection is closed.
      However, the http client pools are created per JDBC Connection, so the pooling is effectively only used when concurrent statements are executed from the same Connection object.
      This also means that when the application opens and closes a lot of Connections, then every Connection leaves behind active (typically in CLOSE_WAIT) TCP connections, which are only cleaned up on GC.
      This wastes resources, and eventually breaks the application, as connection limits are reached.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            stoty Istvan Toth
            stoty Istvan Toth
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 40m
                40m

                Slack

                  Issue deployment