Skip to content

Issue #5088 Review ContextHandler locking #5094

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

Merged
merged 3 commits into from
Jul 30, 2020

Conversation

gregw
Copy link
Contributor

@gregw gregw commented Jul 29, 2020

The locking was primarily as a memory guard for the availability status, which was already volatile.
Have instead using an AtomicReference with a simple state machine layered on top of start/stop lifecycle.
There was also protection for AttributesMap, which is no longer needed as AttributesMap is now concurrent.

The locking was primarily as a memory guard for the availability status, which was already volatile.
Have instead using an AtomicReference with a simple state machine layered on top of start/stop lifecycle.
There was also protection for AttributesMap, which is no longer needed as AttributesMap is now concurrent.
@@ -1805,7 +1805,7 @@ public void setMetaData(org.eclipse.jetty.http.MetaData.Request request)
}
else if (encoded.startsWith("/"))
{
path = (encoded.length() == 1) ? "/" : URIUtil.canonicalPath(URIUtil.decodePath(encoded));
path = (encoded.length() == 1) ? "/" : URIUtil.canonicalPath(uri.getDecodedPath());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops this is an unrelated change that accidentally slipped in.
The uri.getDecodedPath() method does exactly URIUtil.decodePath(encoded), but caches the results so they can be reused if needed again.

Copy link
Contributor

@janbartel janbartel left a comment

Choose a reason for hiding this comment

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

I wonder if this should be done in 9 or 10? We are changing the signature of exposed methods, albeit only via removal of the "synchronized" keyword, but tooling may flag this as an api compatibility problem for a point release?

@@ -230,10 +231,10 @@ public static void setServerInfo(String serverInfo)

public enum Availability
{
UNAVAILABLE, STARTING, AVAILABLE, SHUTDOWN,
STOPPED, STARTING, AVAILABLE, UNAVAILABLE, SHUTDOWN,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have a comment about the meanings of the different states, particularly UNAVAILABLE vs STOPPED, which is a new state.

updates from review
@gregw gregw linked an issue Jul 29, 2020 that may be closed by this pull request
// canonicalPath() is not responsible for decoding characters
{"/foo/.;/bar", "/foo/.;/bar"},
{"/foo/..;/bar", "/foo/..;/bar"},
{"/foo/..;/..;/bar", "/foo/..;/..;/bar"},
Copy link
Contributor

Choose a reason for hiding this comment

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

This is an unrelated change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, see note explaining it above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh no it's another unrelated change! Double ooops

Copy link
Contributor

Choose a reason for hiding this comment

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

These are useful and good changes.
Just would have liked to see them in a different commit explaining why they were made.
Right now they seem to be related to the change for commit 36b2a4b (Issue #5088 Review ContextHandler Locking), which will be super confusing in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep - my bad!

updates from review (better this time)
@gregw gregw merged commit 66ec160 into jetty-9.4.x Jul 30, 2020
@gregw gregw deleted the jetty-9.4.x-5088-ContextHandlerLocking branch July 30, 2020 15:58
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.

Review ContextHandler locking
3 participants