constellation-app / constellation

A graph-focused data visualisation and interactive analysis application.
https://constellation-app.com
Apache License 2.0
386 stars 58 forks source link

Improve Threadpool management. #2157

Closed OrionsGuardian closed 3 months ago

OrionsGuardian commented 3 months ago

Prerequisites

Description

Some recent changes to the Threadpool creation/usage has caused an issue when multiple graphs are being opened during a session. The global fixed Threadpool gets fully utilised and blocks any further requests for a fixed threadpool. Specifically, when opening a graph, a fixed threadpool connection is claimed for the graph. There is a threadpool limit based on the number of logical processors available on the system. When you try to open more graphs than the number of logical processors, each additional graph will be stuck waiting for a threadpool connection to be allocated, which will never happen.

We need to change the Threadpool usage for new graphs, and the general usage across the system to improve system performance.

Steps to Reproduce

Keep creating new empty graphs until you reach a number greater than the logical processors of the machine. The last graphs will be non-responsive / unusable .

Expected behaviour: Should be able to open an unrestricted number of graphs.

Actual behaviour: Limited number can be opened, and when you go over the limit, the graph is unresponsive with no indication to the user as to why.

Reproduces how often: 100%

HolandCrick commented 3 months ago

@OrionsGuardian - thanks for fixing Threadpool issue when multiple graphs are being opened during a session. I have opened over 20 graphs and played with it without any issue.

image