Re: [tomcat] branch master updated: Partial fix for BZ 63362 provide h2 request statistics
On 09/10/2020 17:43, ma...@apache.org wrote: > This is an automated email from the ASF dual-hosted git repository. > > markt pushed a commit to branch master > in repository https://gitbox.apache.org/repos/asf/tomcat.git > > > The following commit(s) were added to refs/heads/master by this push: > new 62a684c Partial fix for BZ 63362 provide h2 request statistics > 62a684c is described below > > commit 62a684cd2b2039a68e74813cf4e20fc95a2cebe4 > Author: Mark Thomas > AuthorDate: Wed Jun 24 19:24:17 2020 +0100 > > Partial fix for BZ 63362 provide h2 request statistics Just a quick heads up that as I work on WebSocket (and a generic solution for any HTTP upgrade protocol) it is looking as if a chunk of the changes below are going to be reverted. Mark > --- > java/org/apache/coyote/AbstractProtocol.java | 35 +++ > java/org/apache/coyote/LocalStrings.properties| 1 + > java/org/apache/coyote/UpgradeProtocol.java | 22 > java/org/apache/coyote/http2/Http2Protocol.java | 41 > +++ > java/org/apache/coyote/http2/StreamProcessor.java | 6 > webapps/docs/changelog.xml| 4 +++ > 6 files changed, 102 insertions(+), 7 deletions(-) > > diff --git a/java/org/apache/coyote/AbstractProtocol.java > b/java/org/apache/coyote/AbstractProtocol.java > index e214f80..159531e 100644 > --- a/java/org/apache/coyote/AbstractProtocol.java > +++ b/java/org/apache/coyote/AbstractProtocol.java > @@ -69,12 +69,6 @@ public abstract class AbstractProtocol implements > ProtocolHandler, > > > /** > - * Name of MBean for the Global Request Processor. > - */ > -protected ObjectName rgOname = null; > - > - > -/** > * Unique ID for this connector. Only used if the connector is configured > * to use a random port as the port will change if stop(), start() is > * called. > @@ -145,6 +139,14 @@ public abstract class AbstractProtocol implements > ProtocolHandler, > // --- Properties managed by the > ProtocolHandler > > /** > + * Name of MBean for the Global Request Processor. > + */ > +protected ObjectName rgOname = null; > +public ObjectName getGlobalRequestProcessorMBeanName() { > +return rgOname; > +} > + > +/** > * The adapter provides the link between the ProtocolHandler and the > * connector. > */ > @@ -546,7 +548,8 @@ public abstract class AbstractProtocol implements > ProtocolHandler, > } > > if (this.domain != null) { > -rgOname = new ObjectName(domain + > ":type=GlobalRequestProcessor,name=" + getName()); > +ObjectName rgOname = new ObjectName(domain + > ":type=GlobalRequestProcessor,name=" + getName()); > +this.rgOname = rgOname; > Registry.getRegistry(null, null).registerComponent( > getHandler().getGlobal(), rgOname, null); > } > @@ -556,6 +559,13 @@ public abstract class AbstractProtocol implements > ProtocolHandler, > endpoint.setDomain(domain); > > endpoint.init(); > + > +UpgradeProtocol[] upgradeProtocols = findUpgradeProtocols(); > +for (UpgradeProtocol upgradeProtocol : upgradeProtocols) { > +// Implementation note: Failure of one upgrade protocol fails the > +// whole Connector > +upgradeProtocol.init(); > +} > } > > > @@ -669,6 +679,16 @@ public abstract class AbstractProtocol implements > ProtocolHandler, > logPortOffset(); > } > > +UpgradeProtocol[] upgradeProtocols = findUpgradeProtocols(); > +for (UpgradeProtocol upgradeProtocol : upgradeProtocols) { > +try { > +upgradeProtocol.destroy(); > +} catch (Throwable t) { > +ExceptionUtils.handleThrowable(t); > + > getLog().error(sm.getString("abstractProtocol.upgradeProtocolDestroyError"), > t); > +} > +} > + > try { > endpoint.destroy(); > } finally { > @@ -686,6 +706,7 @@ public abstract class AbstractProtocol implements > ProtocolHandler, > } > } > > +ObjectName rgOname = getGlobalRequestProcessorMBeanName(); > if (rgOname != null) { > Registry.getRegistry(null, > null).unregisterComponent(rgOname); > } > diff --git a/java/org/apache/coyote/LocalStrings.properties > b/java/org/apache/coyote/LocalStrings.properties > index 83960cb..43c8d64 100644 > --- a/java/org/apache/coyote/LocalStrings.properties > +++ b/java/org/apache/coyote/LocalStrings.properties > @@ -36,6 +36,7 @@ abstractProcessor.socket.ssl=Exception getting SSL > attributes > abstractProtocol.mbeanDeregistrationFailed=Failed to deregister MBean named > [{0}] from MBean server [{1}] >
[tomcat] branch master updated: Partial fix for BZ 63362 provide h2 request statistics
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/master by this push: new 62a684c Partial fix for BZ 63362 provide h2 request statistics 62a684c is described below commit 62a684cd2b2039a68e74813cf4e20fc95a2cebe4 Author: Mark Thomas AuthorDate: Wed Jun 24 19:24:17 2020 +0100 Partial fix for BZ 63362 provide h2 request statistics --- java/org/apache/coyote/AbstractProtocol.java | 35 +++ java/org/apache/coyote/LocalStrings.properties| 1 + java/org/apache/coyote/UpgradeProtocol.java | 22 java/org/apache/coyote/http2/Http2Protocol.java | 41 +++ java/org/apache/coyote/http2/StreamProcessor.java | 6 webapps/docs/changelog.xml| 4 +++ 6 files changed, 102 insertions(+), 7 deletions(-) diff --git a/java/org/apache/coyote/AbstractProtocol.java b/java/org/apache/coyote/AbstractProtocol.java index e214f80..159531e 100644 --- a/java/org/apache/coyote/AbstractProtocol.java +++ b/java/org/apache/coyote/AbstractProtocol.java @@ -69,12 +69,6 @@ public abstract class AbstractProtocol implements ProtocolHandler, /** - * Name of MBean for the Global Request Processor. - */ -protected ObjectName rgOname = null; - - -/** * Unique ID for this connector. Only used if the connector is configured * to use a random port as the port will change if stop(), start() is * called. @@ -145,6 +139,14 @@ public abstract class AbstractProtocol implements ProtocolHandler, // --- Properties managed by the ProtocolHandler /** + * Name of MBean for the Global Request Processor. + */ +protected ObjectName rgOname = null; +public ObjectName getGlobalRequestProcessorMBeanName() { +return rgOname; +} + +/** * The adapter provides the link between the ProtocolHandler and the * connector. */ @@ -546,7 +548,8 @@ public abstract class AbstractProtocol implements ProtocolHandler, } if (this.domain != null) { -rgOname = new ObjectName(domain + ":type=GlobalRequestProcessor,name=" + getName()); +ObjectName rgOname = new ObjectName(domain + ":type=GlobalRequestProcessor,name=" + getName()); +this.rgOname = rgOname; Registry.getRegistry(null, null).registerComponent( getHandler().getGlobal(), rgOname, null); } @@ -556,6 +559,13 @@ public abstract class AbstractProtocol implements ProtocolHandler, endpoint.setDomain(domain); endpoint.init(); + +UpgradeProtocol[] upgradeProtocols = findUpgradeProtocols(); +for (UpgradeProtocol upgradeProtocol : upgradeProtocols) { +// Implementation note: Failure of one upgrade protocol fails the +// whole Connector +upgradeProtocol.init(); +} } @@ -669,6 +679,16 @@ public abstract class AbstractProtocol implements ProtocolHandler, logPortOffset(); } +UpgradeProtocol[] upgradeProtocols = findUpgradeProtocols(); +for (UpgradeProtocol upgradeProtocol : upgradeProtocols) { +try { +upgradeProtocol.destroy(); +} catch (Throwable t) { +ExceptionUtils.handleThrowable(t); + getLog().error(sm.getString("abstractProtocol.upgradeProtocolDestroyError"), t); +} +} + try { endpoint.destroy(); } finally { @@ -686,6 +706,7 @@ public abstract class AbstractProtocol implements ProtocolHandler, } } +ObjectName rgOname = getGlobalRequestProcessorMBeanName(); if (rgOname != null) { Registry.getRegistry(null, null).unregisterComponent(rgOname); } diff --git a/java/org/apache/coyote/LocalStrings.properties b/java/org/apache/coyote/LocalStrings.properties index 83960cb..43c8d64 100644 --- a/java/org/apache/coyote/LocalStrings.properties +++ b/java/org/apache/coyote/LocalStrings.properties @@ -36,6 +36,7 @@ abstractProcessor.socket.ssl=Exception getting SSL attributes abstractProtocol.mbeanDeregistrationFailed=Failed to deregister MBean named [{0}] from MBean server [{1}] abstractProtocol.processorRegisterError=Error registering request processor abstractProtocol.processorUnregisterError=Error unregistering request processor +abstractProtocol.upgradeProtocolDestroyError=Error destroying upgrade protocol abstractProtocol.waitingProcessor.add=Added processor [{0}] to waiting processors abstractProtocol.waitingProcessor.remove=Removed processor [{0}] from waiting processors diff --git a/java/org/apache/coyote/UpgradeProtocol.java b/java/org/apache/coyote/UpgradeProtocol.java index