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

Issue #6329 Fix xml config problems #6348

Merged
merged 8 commits into from Jun 10, 2021

Conversation

janbartel
Copy link
Contributor

@janbartel janbartel commented Jun 2, 2021

Closes #6392

The original problem that was reported in #6329 was the configuration for Server.setStopAtShutdown had been mistakenly changed from a default of true to false, prompting a full review of the changes from the relevant commit (343cf73). This PR puts back some other changes that look like mistakes, but can reviewers @sbordet @gregw and @joakime check carefully if these changes are indeed needed. I've simplified the session xml configs to put the defaults into code rather than xml where possible.

Signed-off-by: Jan Bartel <janb@webtide.com>
@janbartel janbartel self-assigned this Jun 2, 2021
@janbartel janbartel added this to In progress in Jetty 10.0.4/11.0.4 FROZEN via automation Jun 2, 2021
Copy link
Contributor

@joakime joakime left a comment

Choose a reason for hiding this comment

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

The default for Server.stopAtShutdown should remain false (for embedded users).

Jetty 10.0.4/11.0.4 FROZEN automation moved this from In progress to Review in progress Jun 2, 2021
Signed-off-by: Jan Bartel <janb@webtide.com>
@janbartel janbartel requested a review from joakime June 3, 2021 01:33
Copy link
Contributor

@sbordet sbordet left a comment

Choose a reason for hiding this comment

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

Every change in XML config files requires likely a change in the [ini-template] section of the correspondent *.mod file.

@janbartel
Copy link
Contributor Author

@sbordet the changes I have made do not require any changes in the corresponding .mod files - I checked them all and if a value is specified in the .xml, it is the same as the (commented out!) value in the .mod file and the pre 343cf73 commit values.

In many cases, the commented out value in the .mod file or the value supplied in the .xml file is different to the defaults in the code. Can you and @gregw please give some guidance on which values can be changed in the code vs which need to remain defaulted only in the .xml?

@janbartel janbartel requested review from gregw and sbordet June 4, 2021 01:28
@gregw
Copy link
Contributor

gregw commented Jun 4, 2021

@janbartel I'll defer my re-review until @sbordet comments

@sbordet sbordet removed this from Review in progress in Jetty 10.0.4/11.0.4 FROZEN Jun 4, 2021
@sbordet sbordet added this to In progress in Jetty 10.0.5/11.0.5 FROZEN via automation Jun 4, 2021
joakime
joakime previously approved these changes Jun 4, 2021
Copy link
Contributor

@joakime joakime left a comment

Choose a reason for hiding this comment

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

There are still changes for embedded mode users.

Jetty 10.0.5/11.0.5 FROZEN automation moved this from In progress to Review in progress Jun 7, 2021
Signed-off-by: Jan Bartel <janb@webtide.com>
@janbartel
Copy link
Contributor Author

@gregw @sbordet I have removed the defaults set in xml in favour of using the defaults in the code as discussed. Where appropriate I have changed the .mod files to also use the same values as the code defaults. Please rereview.

@janbartel janbartel requested a review from sbordet June 8, 2021 03:54
gregw
gregw previously approved these changes Jun 8, 2021
Copy link
Contributor

@sbordet sbordet left a comment

Choose a reason for hiding this comment

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

There seems to be a lot of breaking changes in XML files that seem to be out of scope for this PR, if the scope was initially to fix stopOnShutdown behavior.

Also, feels like many/most properties should be property attributes so that embedded and standalone have the same configuration.
However, some property attribute was changed to Property element and viceversa, but could not find a clear logic for that?

@@ -10,7 +10,7 @@
<Arg>
<New id="ThreadLimitHandler" class="org.eclipse.jetty.server.handler.ThreadLimitHandler">
<Arg name="forwardedHeader"><Property name="jetty.threadlimit.forwardedHeader"/></Arg>
<Set name="enabled" property="jetty.threadlimit.enabled"/>
<Set name="enabled"><Property name="jetty.threadlimit.enabled" default="true"/></Set>
Copy link
Contributor

Choose a reason for hiding this comment

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

Was not enabled before, why was changed to enabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because if its not enabled it's not doing anything, and the value previously was true, so I've reinstated it. The value in the class is false. Again, see commit 343cf73

Copy link
Contributor

Choose a reason for hiding this comment

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

Again, breaks the behavior of all Jetty 10 releases.
If it's a wrong value, let's open a new issue rather than doing it here where it gets lost in other changes.

@@ -66,7 +66,7 @@
<Set name="requestHeaderSize" property="jetty.httpConfig.requestHeaderSize"/>
<Set name="responseHeaderSize" property="jetty.httpConfig.responseHeaderSize"/>
<Set name="sendServerVersion" property="jetty.httpConfig.sendServerVersion"/>
<Set name="sendDateHeader" property="jetty.httpConfig.sendDateHeader"/>
<Set name="sendDateHeader"><Property name="jetty.httpConfig.sendDateHeader" default="false"/></Set>
Copy link
Contributor

Choose a reason for hiding this comment

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

Another behavior change? Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sbordet I don't think you've understood the fundamental of this PR :) The whole point is that commit 343cf73 accidentally changed the configuration by removing the default values, so this PR is putting them back the way they were.

Signed-off-by: Jan Bartel <janb@webtide.com>
@janbartel janbartel requested a review from sbordet June 9, 2021 10:57
joakime
joakime previously approved these changes Jun 9, 2021
@sbordet
Copy link
Contributor

sbordet commented Jun 9, 2021

I think it's a mistake to try to revert 343cf73.

All releases of Jetty 10, since 10.0.0-alpha0 included, had the 343cf73 behavior.
Which means that no official release of Jetty 10 had any different behavior.

This PR is trying to revert that commit and instate many new behaviors, breaking who was relying on the behavior of basically all the Jetty 10 releases.

@janbartel if you look at the issue that generated this PR (#6329), it was about jetty.server.stopAtShutdown only.
That it was caused by 343cf73 does not mean that we have to change many other behaviors.

I'm fine to change <Property> elements into attributes or viceversa, as long as the behavior is maintained or it's a blatant bug like stopAtShutdown.

If there are wrong behaviors, let's review them in different issues so we can enumerate the behaviors that were changed one by one in the release notes, and at least users will know what behavior changed and why.

jetty-server/src/main/config/etc/jetty-gzip.xml Outdated Show resolved Hide resolved
@@ -10,7 +10,7 @@
<Arg>
<New id="ThreadLimitHandler" class="org.eclipse.jetty.server.handler.ThreadLimitHandler">
<Arg name="forwardedHeader"><Property name="jetty.threadlimit.forwardedHeader"/></Arg>
<Set name="enabled" property="jetty.threadlimit.enabled"/>
<Set name="enabled"><Property name="jetty.threadlimit.enabled" default="true"/></Set>
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, breaks the behavior of all Jetty 10 releases.
If it's a wrong value, let's open a new issue rather than doing it here where it gets lost in other changes.

jetty-server/src/main/config/modules/gzip.mod Show resolved Hide resolved
@gregw
Copy link
Contributor

gregw commented Jun 9, 2021

@sbordet you can't both argue that this is an issue that can be punted from a release train AND that the behavior should be kept as the changed one because of previous releases.

I think version 1 if this PR did just fix the missing attribute issue until @joakime pointed out the inadvertent behavior change.

I see no reason to keep any accidental behavior changes

Signed-off-by: Jan Bartel <janb@webtide.com>
@janbartel
Copy link
Contributor Author

I think it's a mistake to try to revert 343cf73.

All releases of Jetty 10, since 10.0.0-alpha0 included, had the 343cf73 behavior.
Which means that no official release of Jetty 10 had any different behavior.

Which means that all official releases of jetty-10 are in fact incorrect/broken.
Just because we have had n broken releases is not a reason to make n+1.

This PR is trying to revert that commit and instate many new behaviors, breaking who was relying on the behavior of basically all the Jetty 10 releases.

@janbartel if you look at the issue that generated this PR (#6329), it was about jetty.server.stopAtShutdown only.
That it was caused by 343cf73 does not mean that we have to change many other behaviors.

I'm fine to change elements into attributes or viceversa, as long as the behavior is maintained or it's a blatant bug like stopAtShutdown.
Well, the InflaterPool/DeflaterPool is a blatant bug. If anyone had actually configured a property value, jetty would not have been able to start.

The jetty-threadlimit.xml is also a blatant bug: if you enabled the threadlimit module, you would be forgiven for assuming it was actually limiting, but without this change it is not!

The only nice-to-haves is the clean-up of the session modules default values, the rest you can easily argue are blatant bugs, or rotten .mod files.

If there are wrong behaviors, let's review them in different issues so we can enumerate the behaviors that were changed one by one in the release notes, and at least users will know what behavior changed and why.

@sbordet sbordet self-requested a review June 10, 2021 08:27
Jetty 10.0.5/11.0.5 FROZEN automation moved this from Review in progress to Reviewer approved Jun 10, 2021
@janbartel janbartel merged commit 103e1d9 into jetty-10.0.x Jun 10, 2021
Jetty 10.0.5/11.0.5 FROZEN automation moved this from Reviewer approved to Done Jun 10, 2021
@janbartel janbartel deleted the jetty-10.0.x-6329-xml-config-fixes branch June 10, 2021 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Review accidental xml config changes
4 participants