-
Defect
-
Resolution: Done
-
Standard
-
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
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