-
Notifications
You must be signed in to change notification settings - Fork 187
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
Improve performance, eliminate ConcurrentModificationException and eliminate stucks #558
Conversation
…TM/lockable-resources-plugin into concurent-modification
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.
While the latest release ends in a deadlock within hours, this PR works fine so far! 👍
src/main/java/org/jenkins/plugins/lockableresources/LockStepExecution.java
Outdated
Show resolved
Hide resolved
@offa thx for your confirmation, I will merge this changes, when the last commit has been checked. |
Hi mPokornyETM,
|
I created #623 for this |
Hi |
fix #550
fix #503
fix #149
fix #566
fix #597
close #151
In our company we use many resources (more the 400) and many jobs (100 ~ 1000) in one Jenkins instance.
We try to upgrade to latest Jenkins LTS and we recognize, that our jobs are often frozen. Also allocating existing resources takes really long time (sometimes minutes)
After the first analysis, we recognized, that it got stuck by lockable-resources-plugin. Because (and this is the paradox) the Jenkins is faster, then before.
Therefore it was necessary to refactor synchronization in this plugin.
As first step we provided a pressure-test, that can simulate many jobs, many nodes, many resources in many parallel stages.
This was a good idea, because we can vary time (and also with older Jenkins versions) simulate the ConcurrentModificationException raises and also we can simulate, when plugin get stuck.
Implementing of synchronization solve both issues, but the plugin being very slowly. Therefore we tried to improve performance. Currently (in this PR) it looks pretty fine.
We will be happy, when somebody else can review this changes. Probably it will be hard, because there are many.
PS: due many changes is the review hard. Therefore I decide to split it to smaller PRs. There are many other fixes as well.
After them it shall be much more easy.
Testing done
Added new pressure-test. All other test are OK on Windows and Unix
Proposed upgrade guidelines
This change may break your pipelines, when you access LockableResourcesManager or LockableResource from groovy, because all this operation can not be synchronized correctly. Please check your pipeline (or shared library) code, before you upgrade to this version.
TODO
still open
Submitter checklist
@NoExternalUse
. In case it is used by non java code theUsed by {@code <panel>.jelly}
Javadocs are annotated.[ ] New or substantially changed JavaScript is not defined inline and does not calleval
to ease the future introduction of Content Security Policy (CSP) directives (see documentation).[ ] For dependency updates, there are links to external changelogs and, if possible, full differentials.[ ] For new APIs and extension points, there is a link to at least one consumer.[ ] Changes in the interface are documented also as examples.Maintainer checklist
Before the changes are marked as
ready-for-merge
:upgrade-guide-needed
label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).@lhoehnETM many thx for support ;-)