Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pooling workflows and Shared connections fun. #1116

Merged
merged 2 commits into from
Apr 14, 2023
Merged

Conversation

aaron-mcgrath-adp
Copy link
Member

Motivation

If you have a pooling workflow that has references to a shared connection, then upon init/start you can get into a situation where multiple threads (each being a worker for the pooling workflow) attempt to register themselves as listeners to the shared connection.
This list of listeners in the shared connection was not thread safe and could cause an infinite loop resulting in Interlok app[earling to hang.

Modification

Simple changed the maps holding the consumers/producers and listeners to be thread safe versions.

Result

Interlok no longer hangs on startup when using a pooling workflow that references shared connections.

… Collections.synchronizedMap.

Also added a unit test that consistently fails when not wrapping the weak map.
@codecov
Copy link

codecov bot commented Apr 13, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.02 ⚠️

Comparison is base (bb15b98) 93.47% compared to head (4767a9d) 93.45%.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #1116      +/-   ##
=============================================
- Coverage      93.47%   93.45%   -0.02%     
- Complexity     11129    11130       +1     
=============================================
  Files           1086     1086              
  Lines          29867    29870       +3     
  Branches        2105     2105              
=============================================
- Hits           27918    27916       -2     
- Misses          1519     1523       +4     
- Partials         430      431       +1     
Impacted Files Coverage Δ
.../java/com/adaptris/core/AdaptrisConnectionImp.java 100.00% <100.00%> (ø)

... and 6 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@sebastien-belin-adp sebastien-belin-adp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love those set initialisation :)

@aaron-mcgrath-adp aaron-mcgrath-adp merged commit 353025f into develop Apr 14, 2023
@aaron-mcgrath-adp aaron-mcgrath-adp deleted the INTERLOK-4039 branch April 14, 2023 09:14
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.

None yet

2 participants