-
Notifications
You must be signed in to change notification settings - Fork 218
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
Fix #1060 Enable Slack#close() method to shutdown thread pools behind its SlackConfig #1064
Conversation
…s behind its SlackConfig
The CI builds seem to be detecting some race condition issues:
|
^ the above issue was due to the test code quality. improved. |
Codecov Report
@@ Coverage Diff @@
## main #1064 +/- ##
============================================
+ Coverage 76.78% 76.80% +0.01%
- Complexity 3718 3733 +15
============================================
Files 407 407
Lines 11197 11250 +53
Branches 1112 1128 +16
============================================
+ Hits 8598 8640 +42
- Misses 1928 1936 +8
- Partials 671 674 +3
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice use of AutoCloseable
, this looks good to me 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I today learned about AutoCloseable
🙇
* In most use cases, this should not be intended. To avoid this, consider reusing SlackConfig objects | ||
* as much as possible. | ||
* <p> | ||
* An alternative way is to set the statsEnabled flag to false. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that these docs are hosted on sonatype.org, and as far as I can tell, can't be previewed locally in Jekyll 😢 .
I wanted to check to see if the references to various classes (i.e. SlackConfig
) and maybe even properties (i.e. statsEnabled
) would link properly. I suppose we won't be able to tell until we merge + deploy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: You can package javadoc.jar files by running mvn command and can unzip the file to check the generated HTML!
This pull request resolves #1060 by enhancing Slack and SlackConfig classes to shutdown thread pools once close() method is called. Also, I've updated the javadoc of the SlackConfig class to clearly mention that reusing the instance is recommended.
To reviewers:
Please don't feel pressured even if you are not familiar with the internals of this SDK. To learn how SlackConfig and its sub config classes are connected to the ThreadPools classes, you can check how
ThreadPools.getOrCreate()
method works.Category (place an
x
in each of the[ ]
)Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.