Skip to content

HTTP Bridge: Replace thread pool - #3956

Open
simon-lgb wants to merge 2 commits into
OpenEMS:developfrom
ses-systeme:fix/http-bridge-concurrency
Open

HTTP Bridge: Replace thread pool#3956
simon-lgb wants to merge 2 commits into
OpenEMS:developfrom
ses-systeme:fix/http-bridge-concurrency

Conversation

@simon-lgb

@simon-lgb simon-lgb commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

This change fixes an issue that prevented http bridge requests from running concurrently, as discussed in https://community.openems.io/t/broken-thread-pools-in-openems/10947.

With this appraoch, I tried to mirror the original intended behavior as closely as possible. However, moving the initialization of the maximum pool size from a method to the constructor would enable the custom subclass of Semaphore to be dropped entirely and the code could be simplified quite a bit. Also, the debug logging could be reduced if desired to remove the need for separate counters.

Originally, I tested this using the MetadataOdoo provider. I also expanded the debug logging there and fixed a deadlock with one of the ConcurrentHashMaps that I discovered once several requests were running concurrently. However, the use of the HTTP bridge in that class was removed in aa79e27, so those changes are not included in this PR. If desired, I can also revert that commit and include those additional changes.

The flawed thread pool pattern exists in other places in the code as well, however this initial PR only touches the HTTP bridge.

I'm looking forward to your feedback :)

This fixes an issue with the thread pool not allowing concurrency regardless of the maximum pool size
@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.84211% with 5 lines in your changes missing coverage. Please review.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #3956      +/-   ##
=============================================
+ Coverage      55.32%   55.34%   +0.03%     
- Complexity     19440    19446       +6     
=============================================
  Files           3840     3840              
  Lines         177236   177265      +29     
  Branches       14801    14802       +1     
=============================================
+ Hits           98035    98088      +53     
+ Misses         75321    75297      -24     
  Partials        3880     3880              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant