[jboss-jira] [JBoss JIRA] (WFCORE-3569) NPE is shown in server shutdown
Richard Opalka (JIRA)
issues at jboss.org
Wed Jan 31 06:50:00 EST 2018
[ https://issues.jboss.org/browse/WFCORE-3569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13526548#comment-13526548 ]
Richard Opalka edited comment on WFCORE-3569 at 1/31/18 6:49 AM:
-----------------------------------------------------------------
The following commit introduced this issue:
https://github.com/xnio/xnio/commit/071800e0a85c9da9b88a976ac7ecb85760924dbf
Before there was DebugAbortPolicy rejection execution handler associated with task pool.
Since now on there's termination task created and associated with task pool.
I was able to reproduce this issue with the following stack traces describing the problem:
---
java.lang.Exception:
at org.jboss.as.server.mgmt.ManagementWorkerService.stopDone(ManagementWorkerService.java:69)
at org.xnio.nio.NioXnioWorker.closeResource(NioXnioWorker.java:264)
at org.xnio.nio.NioXnioWorker.taskPoolTerminated(NioXnioWorker.java:360)
at org.xnio.XnioWorker$1.run(XnioWorker.java:127)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1983)
at org.jboss.threads.EnhancedQueueExecutor.completeTermination(EnhancedQueueExecutor.java:1759)
at org.jboss.threads.EnhancedQueueExecutor.tryDeallocateThread(EnhancedQueueExecutor.java:1580)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1393)
at java.lang.Thread.run(Thread.java:748)
java.lang.Exception:
at org.jboss.as.server.mgmt.ManagementWorkerService.stopDone(ManagementWorkerService.java:69)
at org.xnio.XnioWorker$1.run(XnioWorker.java:138)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1983)
at org.jboss.threads.EnhancedQueueExecutor.completeTermination(EnhancedQueueExecutor.java:1759)
at org.jboss.threads.EnhancedQueueExecutor.tryDeallocateThread(EnhancedQueueExecutor.java:1580)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1393)
at java.lang.Thread.run(Thread.java:748)
---
>From the stack traces above you can see that ManagementWorkerService.stopDone() is called twice.
Further more it is called twice from the same thread while executing terminationTask.
These are the possibilities how to fix this issue:
* either return back to DebugAbortPolicy rejection execution handler
* or eliminate call on line 137 because it "somehow" duplicates what is happening on line 126 already
* or make ManagementWorkerService.stopDone() idempotent
Since I don't know XNIO implementation details I can't say which of above proposals is the appropriate one (if any)
was (Author: ropalka):
The following commit introduced this issue:
https://github.com/xnio/xnio/commit/071800e0a85c9da9b88a976ac7ecb85760924dbf
Before there was DebugAbortPolicy rejection execution handler associated with task pool.
Since now on there's termination task created and associated with task pool.
I was able to reproduce this issue with the following stack traces describing the problem:
---
java.lang.Exception:
at org.jboss.as.server.mgmt.ManagementWorkerService.stopDone(ManagementWorkerService.java:69)
at org.xnio.nio.NioXnioWorker.closeResource(NioXnioWorker.java:264)
at org.xnio.nio.NioXnioWorker.taskPoolTerminated(NioXnioWorker.java:360)
at org.xnio.XnioWorker$1.run(XnioWorker.java:127)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1983)
at org.jboss.threads.EnhancedQueueExecutor.completeTermination(EnhancedQueueExecutor.java:1759)
at org.jboss.threads.EnhancedQueueExecutor.tryDeallocateThread(EnhancedQueueExecutor.java:1580)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1393)
at java.lang.Thread.run(Thread.java:748)
java.lang.Exception:
at org.jboss.as.server.mgmt.ManagementWorkerService.stopDone(ManagementWorkerService.java:69)
at org.xnio.XnioWorker$1.run(XnioWorker.java:138)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1983)
at org.jboss.threads.EnhancedQueueExecutor.completeTermination(EnhancedQueueExecutor.java:1759)
at org.jboss.threads.EnhancedQueueExecutor.tryDeallocateThread(EnhancedQueueExecutor.java:1580)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1393)
at java.lang.Thread.run(Thread.java:748)
---
>From the stack traces above you can see that ManagementWorkerService.stopDone() is called twice.
Further more it is called twice from the same thread while executing terminationTask.
These are the possibilities how to fix this issue:
* either return back to DebugAbortPolicy rejection execution handler
* or eliminate call on line 137 because it "somehow" duplicates what is happening on line 126 already
* or make ManagementWorkerService.stopDone() idempotent
Since I don't know XNIO implementation details I can't say which of above proposals is the appropriate one (if any)
> NPE is shown in server shutdown
> -------------------------------
>
> Key: WFCORE-3569
> URL: https://issues.jboss.org/browse/WFCORE-3569
> Project: WildFly Core
> Issue Type: Bug
> Components: CLI, Domain Management, IO, Server
> Affects Versions: 4.0.0.Alpha8
> Reporter: Chao Wang
> Assignee: David Lloyd
> Priority: Critical
>
> NullPointerException is shown in server shutdown with an open CLI connection in current WFLY master since WFCORE 4.0.0.Alpha7.
> Start the server and open a CLI connection, then stop server with Ctrl + C. We will see
> {noformat}
> 13:15:09,136 ERROR [org.jboss.threads.errors] (management task-1) Thread Thread[management task-1,5,main] threw an uncaught exception: java.lang.NullPointerException
> at org.jboss.as.server.mgmt.ManagementWorkerService.stopDone(ManagementWorkerService.java:72)
> at org.xnio.XnioWorker$1.run(XnioWorker.java:138)
> at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1979)
> at org.jboss.threads.EnhancedQueueExecutor.completeTermination(EnhancedQueueExecutor.java:1755)
> at org.jboss.threads.EnhancedQueueExecutor.tryDeallocateThread(EnhancedQueueExecutor.java:1578)
> at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1393)
> at java.lang.Thread.run(Thread.java:748)
> {noformat}
> I assign this to David as it seems this is caused by WFCORE-3397 and https://github.com/wildfly/wildfly-core/pull/3072 Please feel free to reassign to correct person.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
More information about the jboss-jira
mailing list