[Red Hat JIRA] (WFLY-14273) Avoid need for unique names for resource-adapter child resources that provide statistics
by Brian Stansberry (Jira)
[ https://issues.redhat.com/browse/WFLY-14273?page=com.atlassian.jira.plugi... ]
Brian Stansberry updated WFLY-14273:
------------------------------------
Description:
*Note: This is not simple stuff, so it should only be tackled by people with significant management code expertise.*
Say your configuration has multiple resource-adapter resources, e.g. "my.rar.1", "my.rar.2" etc. And say each of those has a connection-definition resource, each of which has pool-name 'MyConnectionDefinition'. That's a legitimate naming pattern. But because of the way the ManagementResourceRegistration for the RA statistics is registered, there is a race condition that can lead to intermittent failures at boot like the following:
{code}
2021-01-06 10:43:40,113 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.resourceadapters.ra."my.rar".MyConnectionDefinition.STATISTICS: org.jboss.msc.service.StartException in service jboss.resourceadapters.ra."my.rar.1".MyConnectionDefinition.STATISTICS: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: WFLYCTL0218: A node is already registered at '/subsystem=resource-adapters/resource-adapter=*/connection-definitions=MyConnectionDefinition/statistics=pool'
at org.jboss.as.controller.registry.NodeSubregistry.registerChild(NodeSubregistry.java:106)
at org.jboss.as.controller.registry.ConcreteResourceRegistration.registerSubModel(ConcreteResourceRegistration.java:239)
at org.jboss.as.connector.services.resourceadapters.statistics.ConnectionDefinitionStatisticsService.start(ConnectionDefinitionStatisticsService.java:126)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
{code}
I believe a similar thing could happen with 'admin-object' resources.
Note that I considered WFCORE-5240 as the foundation for a solution for this, but it's not a valid foundation. There is no requirement that the MRR registered for different RA should provide the same statistics, so two registration attempts cannot assume that any existing MRR is the right one.
was:
Say your configuration has multiple resource-adapter resources, e.g. "my.rar.1", "my.rar.2" etc. And say each of those has a connection-definition resource, each of which has pool-name 'MyConnectionDefinition'. That's a legitimate naming pattern. But because of the way the ManagementResourceRegistration for the RA statistics is registered, there is a race condition that can lead to intermittent failures at boot like the following:
{code}
2021-01-06 10:43:40,113 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.resourceadapters.ra."my.rar".MyConnectionDefinition.STATISTICS: org.jboss.msc.service.StartException in service jboss.resourceadapters.ra."my.rar.1".MyConnectionDefinition.STATISTICS: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: WFLYCTL0218: A node is already registered at '/subsystem=resource-adapters/resource-adapter=*/connection-definitions=MyConnectionDefinition/statistics=pool'
at org.jboss.as.controller.registry.NodeSubregistry.registerChild(NodeSubregistry.java:106)
at org.jboss.as.controller.registry.ConcreteResourceRegistration.registerSubModel(ConcreteResourceRegistration.java:239)
at org.jboss.as.connector.services.resourceadapters.statistics.ConnectionDefinitionStatisticsService.start(ConnectionDefinitionStatisticsService.java:126)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
{code}
I believe a similar thing could happen with 'admin-object' resources.
Note that I considered WFCORE-5240 as the foundation for a solution for this, but it's not a valid foundation. There is no requirement that the MRR registered for different RA should provide the same statistics, so two registration attempts cannot assume that any existing MRR is the right one.
> Avoid need for unique names for resource-adapter child resources that provide statistics
> ----------------------------------------------------------------------------------------
>
> Key: WFLY-14273
> URL: https://issues.redhat.com/browse/WFLY-14273
> Project: WildFly
> Issue Type: Enhancement
> Components: JCA, Management
> Reporter: Brian Stansberry
> Assignee: Tomasz Adamski
> Priority: Major
>
> *Note: This is not simple stuff, so it should only be tackled by people with significant management code expertise.*
> Say your configuration has multiple resource-adapter resources, e.g. "my.rar.1", "my.rar.2" etc. And say each of those has a connection-definition resource, each of which has pool-name 'MyConnectionDefinition'. That's a legitimate naming pattern. But because of the way the ManagementResourceRegistration for the RA statistics is registered, there is a race condition that can lead to intermittent failures at boot like the following:
> {code}
> 2021-01-06 10:43:40,113 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.resourceadapters.ra."my.rar".MyConnectionDefinition.STATISTICS: org.jboss.msc.service.StartException in service jboss.resourceadapters.ra."my.rar.1".MyConnectionDefinition.STATISTICS: Failed to start service
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)
> at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
> at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
> at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
> at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
> at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
> at java.lang.Thread.run(Thread.java:748)
> Caused by: java.lang.IllegalArgumentException: WFLYCTL0218: A node is already registered at '/subsystem=resource-adapters/resource-adapter=*/connection-definitions=MyConnectionDefinition/statistics=pool'
> at org.jboss.as.controller.registry.NodeSubregistry.registerChild(NodeSubregistry.java:106)
> at org.jboss.as.controller.registry.ConcreteResourceRegistration.registerSubModel(ConcreteResourceRegistration.java:239)
> at org.jboss.as.connector.services.resourceadapters.statistics.ConnectionDefinitionStatisticsService.start(ConnectionDefinitionStatisticsService.java:126)
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
> {code}
> I believe a similar thing could happen with 'admin-object' resources.
> Note that I considered WFCORE-5240 as the foundation for a solution for this, but it's not a valid foundation. There is no requirement that the MRR registered for different RA should provide the same statistics, so two registration attempts cannot assume that any existing MRR is the right one.
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
3 years, 9 months
[Red Hat JIRA] (WFLY-14273) Avoid need for unique names for resource-adapter child resources that provide statistics
by Brian Stansberry (Jira)
[ https://issues.redhat.com/browse/WFLY-14273?page=com.atlassian.jira.plugi... ]
Brian Stansberry commented on WFLY-14273:
-----------------------------------------
This is not trivial stuff, so it should only be tackled by people with significant management code expertise.
A possible solution is for RaAdd to add an override ManagementResourceRegistration at the /subsytem=resource=adapters/resource-adapter level, and then the override MRR for the statistics would be for /subsytem=resource=adapters/resource-adapter=my.rar.1/connection-definition=MyConnectionDefinition/statistics=pool.
RaRemove would need to remove that override.
> Avoid need for unique names for resource-adapter child resources that provide statistics
> ----------------------------------------------------------------------------------------
>
> Key: WFLY-14273
> URL: https://issues.redhat.com/browse/WFLY-14273
> Project: WildFly
> Issue Type: Enhancement
> Components: JCA, Management
> Reporter: Brian Stansberry
> Assignee: Tomasz Adamski
> Priority: Major
>
> Say your configuration has multiple resource-adapter resources, e.g. "my.rar.1", "my.rar.2" etc. And say each of those has a connection-definition resource, each of which has pool-name 'MyConnectionDefinition'. That's a legitimate naming pattern. But because of the way the ManagementResourceRegistration for the RA statistics is registered, there is a race condition that can lead to intermittent failures at boot like the following:
> {code}
> 2021-01-06 10:43:40,113 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.resourceadapters.ra."my.rar".MyConnectionDefinition.STATISTICS: org.jboss.msc.service.StartException in service jboss.resourceadapters.ra."my.rar.1".MyConnectionDefinition.STATISTICS: Failed to start service
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)
> at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
> at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
> at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
> at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
> at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
> at java.lang.Thread.run(Thread.java:748)
> Caused by: java.lang.IllegalArgumentException: WFLYCTL0218: A node is already registered at '/subsystem=resource-adapters/resource-adapter=*/connection-definitions=MyConnectionDefinition/statistics=pool'
> at org.jboss.as.controller.registry.NodeSubregistry.registerChild(NodeSubregistry.java:106)
> at org.jboss.as.controller.registry.ConcreteResourceRegistration.registerSubModel(ConcreteResourceRegistration.java:239)
> at org.jboss.as.connector.services.resourceadapters.statistics.ConnectionDefinitionStatisticsService.start(ConnectionDefinitionStatisticsService.java:126)
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
> {code}
> I believe a similar thing could happen with 'admin-object' resources.
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
3 years, 9 months
[Red Hat JIRA] (WFLY-14273) Avoid need for unique names for resource-adapter child resources that provide statistics
by Brian Stansberry (Jira)
[ https://issues.redhat.com/browse/WFLY-14273?page=com.atlassian.jira.plugi... ]
Brian Stansberry commented on WFLY-14273:
-----------------------------------------
A workaround is to use unique pool-name values globally across the resource-adapter resources.
> Avoid need for unique names for resource-adapter child resources that provide statistics
> ----------------------------------------------------------------------------------------
>
> Key: WFLY-14273
> URL: https://issues.redhat.com/browse/WFLY-14273
> Project: WildFly
> Issue Type: Enhancement
> Components: JCA, Management
> Reporter: Brian Stansberry
> Assignee: Tomasz Adamski
> Priority: Major
>
> Say your configuration has multiple resource-adapter resources, e.g. "my.rar.1", "my.rar.2" etc. And say each of those has a connection-definition resource, each of which has pool-name 'MyConnectionDefinition'. That's a legitimate naming pattern. But because of the way the ManagementResourceRegistration for the RA statistics is registered, there is a race condition that can lead to intermittent failures at boot like the following:
> {code}
> 2021-01-06 10:43:40,113 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.resourceadapters.ra."my.rar".MyConnectionDefinition.STATISTICS: org.jboss.msc.service.StartException in service jboss.resourceadapters.ra."my.rar.1".MyConnectionDefinition.STATISTICS: Failed to start service
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)
> at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
> at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
> at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
> at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
> at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
> at java.lang.Thread.run(Thread.java:748)
> Caused by: java.lang.IllegalArgumentException: WFLYCTL0218: A node is already registered at '/subsystem=resource-adapters/resource-adapter=*/connection-definitions=MyConnectionDefinition/statistics=pool'
> at org.jboss.as.controller.registry.NodeSubregistry.registerChild(NodeSubregistry.java:106)
> at org.jboss.as.controller.registry.ConcreteResourceRegistration.registerSubModel(ConcreteResourceRegistration.java:239)
> at org.jboss.as.connector.services.resourceadapters.statistics.ConnectionDefinitionStatisticsService.start(ConnectionDefinitionStatisticsService.java:126)
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
> {code}
> I believe a similar thing could happen with 'admin-object' resources.
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
3 years, 9 months
[Red Hat JIRA] (WFLY-14273) Avoid need for unique names for resource-adapter child resources that provide statistics
by Brian Stansberry (Jira)
Brian Stansberry created WFLY-14273:
---------------------------------------
Summary: Avoid need for unique names for resource-adapter child resources that provide statistics
Key: WFLY-14273
URL: https://issues.redhat.com/browse/WFLY-14273
Project: WildFly
Issue Type: Enhancement
Components: JCA, Management
Reporter: Brian Stansberry
Assignee: Tomasz Adamski
Say your configuration has multiple resource-adapter resources, e.g. "my.rar.1", "my.rar.2" etc. And say each of those has a connection-definition resource, each of which has pool-name 'MyConnectionDefinition'. That's a legitimate naming pattern. But because of the way the ManagementResourceRegistration for the RA statistics is registered, there is a race condition that can lead to intermittent failures at boot like the following:
{code}
2021-01-06 10:43:40,113 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.resourceadapters.ra."my.rar".MyConnectionDefinition.STATISTICS: org.jboss.msc.service.StartException in service jboss.resourceadapters.ra."my.rar.1".MyConnectionDefinition.STATISTICS: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: WFLYCTL0218: A node is already registered at '/subsystem=resource-adapters/resource-adapter=*/connection-definitions=MyConnectionDefinition/statistics=pool'
at org.jboss.as.controller.registry.NodeSubregistry.registerChild(NodeSubregistry.java:106)
at org.jboss.as.controller.registry.ConcreteResourceRegistration.registerSubModel(ConcreteResourceRegistration.java:239)
at org.jboss.as.connector.services.resourceadapters.statistics.ConnectionDefinitionStatisticsService.start(ConnectionDefinitionStatisticsService.java:126)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
{code}
I believe a similar thing could happen with 'admin-object' resources.
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
3 years, 9 months
[Red Hat JIRA] (WFLY-14247) Error Page is not displayed when trying to access META-INF or WEB-INF
by Michal Petrov (Jira)
[ https://issues.redhat.com/browse/WFLY-14247?page=com.atlassian.jira.plugi... ]
Michal Petrov commented on WFLY-14247:
--------------------------------------
Undertow rejects certain requests straight-away, bypassing the custom error page.
It's because of this method in {{ServletInitialHandler}}
{code:java}
private boolean isForbiddenPath(String path) {
return path.equalsIgnoreCase("/meta-inf/")
|| path.regionMatches(true, 0, "/web-inf/", 0, "/web-inf/".length());
}
{code}
So it will reject "/META-INF/" specifically and anything that starts with "/WEB-INF/".
Allowed request then end up with {{DefaultServlet}} which has this method:
{code:java}
private boolean isAllowed(String path, DispatcherType dispatcherType) {
if (!path.isEmpty()) {
if(dispatcherType == DispatcherType.REQUEST) {
//WFLY-3543 allow the dispatcher to access stuff in web-inf and meta inf
if (path.startsWith("/META-INF") ||
path.startsWith("META-INF") ||
path.startsWith("/WEB-INF") ||
path.startsWith("WEB-INF")) {
return false;
}
}
}
…
}
{code}
[~flavia.rainone], do you know why there are two checks set up like this? And shouldn't the first check still forward to the custom error page?
> Error Page is not displayed when trying to access META-INF or WEB-INF
> ---------------------------------------------------------------------
>
> Key: WFLY-14247
> URL: https://issues.redhat.com/browse/WFLY-14247
> Project: WildFly
> Issue Type: Bug
> Components: Web (Undertow)
> Affects Versions: 21.0.2.Final
> Reporter: Melvin Yam
> Assignee: Flavia Rainone
> Priority: Minor
> Attachments: mywebapp.war
>
>
> I have a simple webapp war file with the following structure:
> {quote}{{Listing archive: mywebapp.war}}{{--}}
> {{Path = mywebapp.war}}
> {{Type = zip}}
> {{Physical Size = 1441}}{{Date Time Attr Size Compressed Name}}
> {{------------------- ----- ------------ ------------ ------------------------}}
> {{2020-12-23 20:09:20 ....A 18 18 error.html}}
> {{2020-12-23 20:09:02 ....A 18 18 index.html}}
> {{2020-12-23 20:10:13 D.... 0 0 META-INF}}
> {{2020-12-23 03:16:37 ....A 39 39 META-INF\MANIFEST.MF}}
> {{2020-12-23 20:12:38 D.... 0 0 WEB-INF}}
> {{2020-12-23 20:12:28 D.... 0 0 WEB-INF\classes}}
> {{2020-12-23 20:12:35 D.... 0 0 WEB-INF\lib}}
> {{2020-12-23 20:11:54 ....A 480 248 WEB-INF\web.xml}}
> {{------------------- ----- ------------ ------------ ------------------------}}
> {{2020-12-23 20:12:38 555 323 4 files, 4 folders}}
> {quote}
>
> In web.xml, it defines the error page:
> {quote}<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
> xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0">
> <display-name>mywebapp</display-name>
> <welcome-file-list>
> <welcome-file>index.html</welcome-file>
> </welcome-file-list>
> <error-page>
> <location>/error.html</location>
> </error-page>
> </web-app>
> {quote}
>
> After deploying the webapp successfully in local WildFly server.
> Accessing the following URL will trigger the error page to be shown:
> [http://127.0.0.1:8080/mywebapp/dummy]
> [http://127.0.0.1:8080/mywebapp/META-INF/MANIFEST.MF]
> [http://127.0.0.1:8080/mywebapp/META-INF/dummy/dummy]
>
> However, the following URL will NOT trigger the error page:
> [http://127.0.0.1:8080/mywebapp/META-INF]
> [http://127.0.0.1:8080/mywebapp/WEB-INF]
> [http://127.0.0.1:8080/mywebapp/WEB-INF/web.xml|http://127.0.0.1:8080/mywe...]
> [http://127.0.0.1:8080/mywebapp/WEB-INF/dummy/dummy]
> Instead, it just displays the text "404 - Not Found"
>
>
>
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
3 years, 9 months