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

Review XmlConfiguration locking #5095

Closed
sbordet opened this issue Jul 29, 2020 · 0 comments · Fixed by #5148
Closed

Review XmlConfiguration locking #5095

sbordet opened this issue Jul 29, 2020 · 0 comments · Fixed by #5148
Assignees

Comments

@sbordet
Copy link
Contributor

sbordet commented Jul 29, 2020

Spawned by #5083.

Jetty version
9.4.x

Description
XmlConfiguration has a static instance of XmlParser and in the constructor locks on it and performs the parsing.

This is fine from the locking point of view, but it grabs a JVM-wide lock so that XmlConfigurations can only execute serially, which may not be desirable and may slow down startup.

The JVM-wide XmlParser instance was created once for performance reasons due to costly initialization?
Can we do better?

@gregw gregw self-assigned this Aug 4, 2020
gregw added a commit that referenced this issue Aug 4, 2020
Use a pool of parsers rather than a shared static

Signed-off-by: Greg Wilkins <[email protected]>
gregw added a commit that referenced this issue Aug 10, 2020
gregw added a commit that referenced this issue Aug 11, 2020
gregw added a commit that referenced this issue Aug 11, 2020
gregw added a commit that referenced this issue Aug 11, 2020
gregw added a commit that referenced this issue Aug 12, 2020
* Some updates to the new Pool class:

 + fixed a race with pending reservations
 + use a pending counter
 + Reservation API to simplify Entry API
 + removed public methods on Entry API

* Some updates to the new Pool class:

 + fixed a race with pending reservations
 + use a pending counter
 + Reservation API to simplify Entry API
 + removed public methods on Entry API

* Updates from review

* Updates from review
Tests for cache size and acquire with creator

* Method no longer required with Reservation

* update from the feedback on the feedback of the feedback from the review.

Moved enable to Entry, removed Reservation class and clarified usage in javadoc

* Issue #5095 XmlConfiguration locking  Use pool instead of static shared instance

fixed javadoc

* Issue #5095 XmlConfiguration locking  Use pool instead of static shared instance

fixed javadoc

* Issue #5095 XmlConfiguration locking  Use pool instead of static shared instance

fixed javadoc

* Issue #5095 XmlConfiguration locking  Use pool instead of static shared instance

updates from review
gregw added a commit that referenced this issue Aug 17, 2020
@joakime joakime linked a pull request Aug 24, 2020 that will close this issue
gregw added a commit that referenced this issue Aug 24, 2020
* Issue #5095 XmlConfiguration Parser Pool

Use a pool of parsers rather than a shared static

Signed-off-by: Greg Wilkins <[email protected]>

* Some updates to the new Pool class:

 + fixed a race with pending reservations
 + use a pending counter
 + Reservation API to simplify Entry API
 + removed public methods on Entry API

* Some updates to the new Pool class:

 + fixed a race with pending reservations
 + use a pending counter
 + Reservation API to simplify Entry API
 + removed public methods on Entry API

* Updates from review

* Updates from review
Tests for cache size and acquire with creator

* Method no longer required with Reservation

* update from the feedback on the feedback of the feedback from the review.

Moved enable to Entry, removed Reservation class and clarified usage in javadoc

* Issue #5095 XmlConfiguration locking  Use pool instead of static shared instance

* removed fake test

Signed-off-by: Greg Wilkins <[email protected]>

* Issue #5095 XmlConfiguration locking  Use pool instead of static shared instance

updates from review
@gregw gregw closed this as completed Aug 24, 2020
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 a pull request may close this issue.

2 participants