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
Merged
Expand Up @@ -10,11 +10,11 @@
<Call name="addBean">
<Arg>
<New id="sessionDataStoreFactory" class="org.eclipse.jetty.gcloud.session.GCloudSessionDataStoreFactory">
<Set name="gracePeriodSec"><Property name="jetty.session.gracePeriod.seconds" default="3600" /></Set>
<Set name="gracePeriodSec" property="jetty.session.gracePeriod.seconds"/>
<Set name="savePeriodSec" property="jetty.session.savePeriod.seconds"/>
<Set name="maxRetries"><Property name="jetty.session.gcloud.maxRetries" default="5"/></Set>
<Set name="maxRetries" property="jetty.session.gcloud.maxRetries"/>
<Set name="backoffMs" property="jetty.session.gcloud.backoffMs"/>
<Set name="namespace" property="jetty.session.gcloud.namespace"/>
<Set name="namespace" property="jetty.session.gcloud.namespace"/>
<Set name="entityDataModel">
<New class="org.eclipse.jetty.gcloud.session.GCloudSessionDataStore$EntityDataModel">
<Set name="kind">
Expand Down Expand Up @@ -44,6 +44,9 @@
<Set name="lastNode">
<Property name="jetty.session.gcloud.model.lastNode" default="lastNode" />
</Set>
<Set name="lastSaved">
<Property name="jetty.session.gcloud.model.lastSaved" default="lastSaved" />
</Set>
gregw marked this conversation as resolved.
Show resolved Hide resolved
<Set name="expiry">
<Property name="jetty.session.gcloud.model.expiry" default="expiry" />
</Set>
Expand Down
Expand Up @@ -55,6 +55,7 @@ public class GCloudSessionDataStore extends AbstractSessionDataStore
public static final int DEFAULT_MAX_QUERY_RESULTS = 100;
public static final int DEFAULT_MAX_RETRIES = 5;
public static final int DEFAULT_BACKOFF_MS = 1000;
public static final String DEFAULT_NAMESPACE = "";

protected Datastore _datastore;
protected KeyFactory _keyFactory;
Expand All @@ -65,7 +66,7 @@ public class GCloudSessionDataStore extends AbstractSessionDataStore
protected boolean _indexesPresent = false;
protected EntityDataModel _model;
protected boolean _modelProvided;
private String _namespace;
private String _namespace = DEFAULT_NAMESPACE;
joakime marked this conversation as resolved.
Show resolved Hide resolved

/**
* EntityDataModel
Expand Down Expand Up @@ -431,7 +432,7 @@ public void setNamespace(String namespace)
_namespace = namespace;
}

@ManagedAttribute(value = "gclound namespace", readonly = true)
@ManagedAttribute(value = "gcloud namespace", readonly = true)
public String getNamespace()
{
return _namespace;
Expand Down
Expand Up @@ -22,9 +22,9 @@
*/
public class GCloudSessionDataStoreFactory extends AbstractSessionDataStoreFactory
{
private String _namespace;
private int _maxRetries;
private int _backoffMs;
private String _namespace = GCloudSessionDataStore.DEFAULT_NAMESPACE;
private int _maxRetries = GCloudSessionDataStore.DEFAULT_MAX_RETRIES;
private int _backoffMs = GCloudSessionDataStore.DEFAULT_BACKOFF_MS;
joakime marked this conversation as resolved.
Show resolved Hide resolved
private GCloudSessionDataStore.EntityDataModel _model;

public GCloudSessionDataStore.EntityDataModel getEntityDataModel()
Expand Down Expand Up @@ -80,8 +80,9 @@ public SessionDataStore getSessionDataStore(SessionHandler handler) throws Excep
ds.setBackoffMs(getBackoffMs());
ds.setMaxRetries(getMaxRetries());
ds.setGracePeriodSec(getGracePeriodSec());
ds.setNamespace(_namespace);
ds.setNamespace(getNamespace());
ds.setSavePeriodSec(getSavePeriodSec());
ds.setEntityDataModel(getEntityDataModel());
return ds;
}
}
Expand Up @@ -14,8 +14,8 @@
<Set name="mapName" property="jetty.session.hazelcast.mapName"/>
<Set name="hazelcastInstanceName" property="jetty.session.hazelcast.hazelcastInstanceName"/>
<Set name="useQueries" property="jetty.session.hazelcast.useQueries"/>
<Set name="gracePeriodSec"><Property name="jetty.session.gracePeriod.seconds" default="3600" /></Set>
<Set name="savePeriodSec"><Property name="jetty.session.savePeriod.seconds" default="0" /></Set>
<Set name="gracePeriodSec" property="jetty.session.gracePeriod.seconds"/>
<Set name="savePeriodSec" property="jetty.session.savePeriod.seconds"/>
<Set name="configurationLocation"><Property name="jetty.session.hazelcast.configurationLocation" default="" /></Set>
</New>
</Arg>
Expand Down
20 changes: 5 additions & 15 deletions jetty-hazelcast/src/main/config/etc/sessions/hazelcast/remote.xml
Expand Up @@ -10,21 +10,11 @@
<Call name="addBean">
<Arg>
<New id="sessionDataStoreFactory" class="org.eclipse.jetty.hazelcast.session.HazelcastSessionDataStoreFactory">
<Set name="mapName">
<Property name="jetty.session.hazelcast.mapName" default="jetty-distributed-session-map" />
</Set>
<Set name="hazelcastInstanceName">
<Property name="jetty.session.hazelcast.hazelcastInstanceName" default="JETTY_DISTRIBUTED_SESSION_INSTANCE" />
</Set>
<Set name="useQueries">
<Property name="jetty.session.hazelcast.useQueries" default="false" />
</Set>
<Set name="gracePeriodSec">
<Property name="jetty.session.gracePeriod.seconds" default="3600" />
</Set>
<Set name="savePeriodSec">
<Property name="jetty.session.savePeriod.seconds" default="0" />
</Set>
<Set name="mapName" property="jetty.session.hazelcast.mapName"/>
<Set name="hazelcastInstanceName" property="jetty.session.hazelcast.hazelcastInstanceName"/>
<Set name="useQueries" property="jetty.session.hazelcast.useQueries"/>
<Set name="gracePeriodSec" property="jetty.session.gracePeriod.seconds"/>
<Set name="savePeriodSec" property="jetty.session.savePeriod.seconds"/>
<Set name="onlyClient">
<Property name="jetty.session.hazelcast.onlyClient" default="true" />
</Set>
janbartel marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Expand Up @@ -9,7 +9,7 @@
<Set name="maxConcurrentStreams" property="jetty.http2c.maxConcurrentStreams"/>
<Set name="initialStreamRecvWindow" property="jetty.http2c.initialStreamRecvWindow"/>
<Set name="initialSessionRecvWindow" property="jetty.http2.initialSessionRecvWindow"/>
<Set name="maxSettingsKeys"><Property name="jetty.http2.maxSettingsKeys" default="64"/></Set>
<Set name="maxSettingsKeys" property="jetty.http2.maxSettingsKeys"/>
<Set name="rateControlFactory">
<New class="org.eclipse.jetty.http2.parser.WindowRateControl$Factory">
<Arg type="int"><Property name="jetty.http2.rateControl.maxEventsPerSecond" default="20"/></Arg>
Expand Down
6 changes: 3 additions & 3 deletions jetty-http2/http2-server/src/main/config/modules/http2c.mod
Expand Up @@ -18,13 +18,13 @@ etc/jetty-http2c.xml
[ini-template]
# tag::documentation[]
## Specifies the maximum number of concurrent requests per session.
# jetty.http2c.maxConcurrentStreams=1024
# jetty.http2c.maxConcurrentStreams=128

## Specifies the initial stream receive window (client to server) in bytes.
# jetty.http2c.initialStreamRecvWindow=65535
# jetty.http2c.initialStreamRecvWindow=524288

## Specifies the initial session receive window (client to server) in bytes.
# jetty.http2.initialSessionRecvWindow=1048576
# jetty.http2.initialSessionRecvWindow=1232896

## Specifies the maximum number of keys in all SETTINGS frames received by a session.
# jetty.http2.maxSettingsKeys=64
Expand Down
Expand Up @@ -9,7 +9,7 @@
<New id="Rewrite" class="org.eclipse.jetty.rewrite.RewriteCustomizer">
<Set name="rewriteRequestURI" property="jetty.rewrite.rewriteRequestURI"/>
<Set name="rewritePathInfo" property="jetty.rewrite.rewritePathInfo"/>
<Set name="originalPathAttribute" property="jetty.rewrite.originalPathAttribute"/>
<Set name="originalPathAttribute"><Property name="jetty.rewrite.originalPathAttribute" default="requestedPath"/></Set>
gregw marked this conversation as resolved.
Show resolved Hide resolved
</New>
</Arg>
</Call>
Expand Down
2 changes: 1 addition & 1 deletion jetty-rewrite/src/main/config/etc/jetty-rewrite.xml
Expand Up @@ -10,7 +10,7 @@
<New class="org.eclipse.jetty.rewrite.handler.RewriteHandler">
<Set name="rewriteRequestURI" property="jetty.rewrite.rewriteRequestURI" />
<Set name="rewritePathInfo" property="jetty.rewrite.rewritePathInfo" />
<Set name="originalPathAttribute" property="jetty.rewrite.originalPathAttribute" />
<Set name="originalPathAttribute"><Property name="jetty.rewrite.originalPathAttribute" default="requestedPath"/></Set>
janbartel marked this conversation as resolved.
Show resolved Hide resolved

<!-- Set DispatcherTypes -->
<Set name="dispatcherTypes">
Expand Down
4 changes: 0 additions & 4 deletions jetty-server/src/main/config/etc/jetty-gzip.xml
Expand Up @@ -13,11 +13,7 @@
<Arg>
<New id="GzipHandler" class="org.eclipse.jetty.server.handler.gzip.GzipHandler">
<Set name="minGzipSize" property="jetty.gzip.minGzipSize"/>
<Set name="checkGzExists" property="jetty.gzip.checkGzExists"/>
<Set name="compressionLevel" property="jetty.gzip.compressionLevel"/>
<Set name="inflateBufferSize" property="jetty.gzip.inflateBufferSize"/>
<Set name="inflaterPoolCapacity" property="jetty.gzip.inflaterPoolCapacity"/>
<Set name="deflaterPoolCapacity" property="jetty.gzip.deflaterPoolCapacity"/>
gregw marked this conversation as resolved.
Show resolved Hide resolved
<Set name="syncFlush" property="jetty.gzip.syncFlush"/>
<Set name="dispatcherTypes" property="jetty.gzip.dispatcherTypes"/>
<Set name="includedMethodList" property="jetty.gzip.includedMethodList"/>
Expand Down
2 changes: 1 addition & 1 deletion jetty-server/src/main/config/etc/jetty-threadlimit.xml
Expand Up @@ -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.

<Set name="threadLimit" property="jetty.threadlimit.threadLimit"/>
</New>
</Arg>
Expand Down
4 changes: 2 additions & 2 deletions jetty-server/src/main/config/etc/jetty.xml
Expand Up @@ -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.

<Set name="headerCacheSize" property="jetty.httpConfig.headerCacheSize"/>
<Set name="delayDispatchUntilContent" property="jetty.httpConfig.delayDispatchUntilContent"/>
<Set name="maxErrorDispatches" property="jetty.httpConfig.maxErrorDispatches"/>
Expand Down Expand Up @@ -105,7 +105,7 @@
<!-- =========================================================== -->
<!-- extra server options -->
<!-- =========================================================== -->
<Set name="stopAtShutdown" property="jetty.server.stopAtShutdown"/>
<Set name="stopAtShutdown"><Property name="jetty.server.stopAtShutdown" default="true"/></Set>
sbordet marked this conversation as resolved.
Show resolved Hide resolved
<Set name="stopTimeout"><Property name="jetty.server.stopTimeout" default="5000"/></Set>
<Set name="dumpAfterStart" property="jetty.server.dumpAfterStart"/>
<Set name="dumpBeforeStop" property="jetty.server.dumpBeforeStop"/>
Expand Down
Expand Up @@ -8,8 +8,8 @@
<Call name="addBean">
<Arg>
<New id="sessionDataStoreFactory" class="org.eclipse.jetty.server.session.JDBCSessionDataStoreFactory">
<Set name="gracePeriodSec"><Property name="jetty.session.gracePeriod.seconds" default="3600" /></Set>
<Set name="savePeriodSec"><Property name="jetty.session.savePeriod.seconds" default="0" /></Set>
<Set name="gracePeriodSec" property="jetty.session.gracePeriod.seconds"/>
<Set name="savePeriodSec" property="jetty.session.savePeriod.seconds"/>
<Set name="databaseAdaptor">
<Ref refid="databaseAdaptor" />
</Set>
Expand Down
2 changes: 1 addition & 1 deletion jetty-server/src/main/config/modules/server.mod
Expand Up @@ -63,7 +63,7 @@ etc/jetty.xml
# jetty.httpConfig.compliance=RFC7230

## URI Compliance: SAFE, STRICT
# jetty.httpConfig.uriCompliance=SAFE
# jetty.httpConfig.uriCompliance=DEFAULT
janbartel marked this conversation as resolved.
Show resolved Hide resolved

## Cookie compliance mode for parsing request Cookie headers: RFC2965, RFC6265
# jetty.httpConfig.requestCookieCompliance=RFC6265
Expand Down
Expand Up @@ -30,12 +30,15 @@
public abstract class AbstractSessionDataStore extends ContainerLifeCycle implements SessionDataStore
{
private static final Logger LOG = LoggerFactory.getLogger(AbstractSessionDataStore.class);

public static final int DEFAULT_GRACE_PERIOD_SEC = 60 * 60; //default of 1hr
public static final int DEFAULT_SAVE_PERIOD_SEC = 0;

protected SessionContext _context; //context associated with this session data store
protected int _gracePeriodSec = 60 * 60; //default of 1hr
protected int _gracePeriodSec = DEFAULT_GRACE_PERIOD_SEC;
protected long _lastExpiryCheckTime = 0; //last time in ms that getExpired was called
protected long _lastOrphanSweepTime = 0; //last time in ms that we deleted orphaned sessions
protected int _savePeriodSec = 0; //time in sec between saves
protected int _savePeriodSec = DEFAULT_SAVE_PERIOD_SEC; //time in sec between saves

/**
* Small utility class to allow us to
Expand Down
Expand Up @@ -19,8 +19,8 @@
public abstract class AbstractSessionDataStoreFactory implements SessionDataStoreFactory
{

int _gracePeriodSec;
int _savePeriodSec;
int _gracePeriodSec = AbstractSessionDataStore.DEFAULT_GRACE_PERIOD_SEC;
int _savePeriodSec = AbstractSessionDataStore.DEFAULT_SAVE_PERIOD_SEC;
janbartel marked this conversation as resolved.
Show resolved Hide resolved

/**
* @return the gracePeriodSec
Expand Down
Expand Up @@ -20,7 +20,7 @@ etc/jetty-unixsocket-http2c.xml

[ini-template]
## Max number of concurrent streams per connection
# jetty.http2.maxConcurrentStreams=1024
# jetty.http2.maxConcurrentStreams=128

## Initial stream receive window (client to server)
# jetty.http2.initialStreamRecvWindow=65535
# jetty.http2.initialStreamRecvWindow=524288