Uploaded image for project: 'Gateway'
  1. Gateway
  2. GTWY-4861

Bestman Command Objects Misuse of SystemExecProcessImpl Causes Thread Exhaustion

XMLWordPrintable

    • Icon: Defect Defect
    • Resolution: Done
    • Icon: Standard Standard
    • 2.1.11
    • 2.1.10
    • None
    • None
    • Sprint 162

      With our recent refactoring of the Bestman code (breaking the SystemExecStorageResourceControlNew class into separate pieces where Command objects are used to encapsulate the actual bestman commands run), we used the SystemExecProcessImpl class wrong.

      Instead of injecting one instance of the SystemExecProcessImpl class into each new Bestman Command created we allowed each Bestman Command to create its own instance of the SystemExecProcessImpl class.

      This was a bad idea in retrospect. The SystemExecProcessImpl class uses the Java ExecutorService class which once created, stays in existence until purposely closed. So we were creating three new threads per new instance of a command. This quickly lead to Thread Exhaustion in the Gateway.

      More information on the ExecutorService:
      https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html

              nhook Nathan Hook
              nhook Nathan Hook
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: