Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-40977

Ship Tomcat's long running (stuck) thread logging by default

    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      NOTE: This suggestion is for Confluence Server. Using Confluence Cloud? See the corresponding suggestion.

      Adding this parameter to the server.xml will log stuck threads in the catalina.out:

      <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60" />
      

      This will log any request thread (eg http thread) that has been processing for more than 60 seconds. This will not log background threads, eg scheduled jobs or any long running operation that processes in the background, like import/export, reindex etc.
      If you are expecting to see something in these logs that you do not, that does not mean it is not running for more than 60s. It likely just means it is not running in a request thread. Thread dumps over time are still the best way to diagnose long running threads.

          Form Name

            [CONFSERVER-40977] Ship Tomcat's long running (stuck) thread logging by default

            Sen Geronimo made changes -
            Workflow Original: JAC Suggestion Workflow 4 [ 3569178 ] New: JAC Suggestion Workflow 3 [ 4339128 ]
            Igor M. made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 564030 ]
            Katherine Yabut made changes -
            Workflow Original: JAC Suggestion Workflow 2 [ 3180249 ] New: JAC Suggestion Workflow 4 [ 3569178 ]
            Status Original: RESOLVED [ 5 ] New: Closed [ 6 ]
            Katherine Yabut made changes -
            Workflow Original: JAC Suggestion Workflow [ 3039861 ] New: JAC Suggestion Workflow 2 [ 3180249 ]
            Owen made changes -
            Workflow Original: Confluence Workflow - Public Facing v4 [ 2527133 ] New: JAC Suggestion Workflow [ 3039861 ]
            Rachel Lin (Inactive) made changes -
            Workflow Original: Confluence Workflow - Public Facing v3 [ 2275471 ] New: Confluence Workflow - Public Facing v4 [ 2527133 ]
            Alex Yakovlev (Inactive) made changes -
            Labels Original: affects-server bugfix loyalty New: affects-server loyalty
            Alex Yakovlev (Inactive) made changes -
            Labels Original: affects-server bugfix New: affects-server bugfix loyalty

            Rilwan_Ahmed_NC added a comment - - edited

            @Heshan Manamperi Increase the threshold to 180.
            This is actually not an issue. Once the threads are free they will get processed.

            In confluence 5.10.4, I see this struck thread when we are running the load test. Eventually it gets complete when the thread processor bocomes free
            Example:
            06-Jun-2017 12:44:40.689 WARNING [ContainerBackgroundProcessor[StandardEngine[Standalone]]] org.apache.catalina.valves.StuckThreadDetectionValve.notifyStuckThreadDetected Thread "http-apr-8443-exec-1233" (id=2713) has been active for 65,998 milliseconds (since 6/6/17 12:43 PM) to serve the same request for https://**************** and may be stuck (configured threshold for this StuckThreadDetectionValve is 60 seconds). There is/are 147 thread(s) in total that are monitored by this Valve and may be stuck.

            Once thread is completed, you can see below message in the Catalina.out

            06-Jun-2017 12:45:46.090 WARNING [ContainerBackgroundProcessor[StandardEngine[Standalone]]] org.apache.catalina.valves.StuckThreadDetectionValve.notifyStuckThreadCompleted Thread "http-apr-8443-exec-1233" (id=2713) was previously reported to be stuck but has completed. It was active for approximately 114,298 milliseconds. There is/are still 186 thread(s) that are monitored by this Valve and may be stuck.

            Rilwan_Ahmed_NC added a comment - - edited @Heshan Manamperi Increase the threshold to 180. This is actually not an issue. Once the threads are free they will get processed. In confluence 5.10.4, I see this struck thread when we are running the load test. Eventually it gets complete when the thread processor bocomes free Example: 06-Jun-2017 12:44:40.689 WARNING [ContainerBackgroundProcessor[StandardEngine [Standalone] ]] org.apache.catalina.valves.StuckThreadDetectionValve.notifyStuckThreadDetected Thread " http-apr-8443-exec-1233" (id=2713) has been active for 65,998 milliseconds (since 6/6/17 12:43 PM) to serve the same request for https://**************** and may be stuck (configured threshold for this StuckThreadDetectionValve is 60 seconds). There is/are 147 thread(s) in total that are monitored by this Valve and may be stuck. Once thread is completed, you can see below message in the Catalina.out 06-Jun-2017 12:45:46.090 WARNING [ContainerBackgroundProcessor[StandardEngine [Standalone] ]] org.apache.catalina.valves.StuckThreadDetectionValve.notifyStuckThreadCompleted Thread " http-apr-8443-exec-1233" (id=2713 ) was previously reported to be stuck but has completed . It was active for approximately 114,298 milliseconds. There is/are still 186 thread(s) that are monitored by this Valve and may be stuck.
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing v3 - TEMP [ 2171977 ] New: Confluence Workflow - Public Facing v3 [ 2275471 ]

              dunterwurzacher Denise Unterwurzacher [Atlassian] (Inactive)
              dunterwurzacher Denise Unterwurzacher [Atlassian] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: