You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Francesco Mari (JIRA)" <ji...@apache.org> on 2016/02/25 16:27:18 UTC

[jira] [Updated] (OAK-4058) Cold Standby intermittently throws RejectedExecutionException

     [ https://issues.apache.org/jira/browse/OAK-4058?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francesco Mari updated OAK-4058:
--------------------------------
    Attachment: OAK-4058.patch

The exception is caused by the order of the cleanup operations in {{StandbyClient#shutdownNetty}}. The thread pool used by {{StandbyClientHandler}} is shut down before the {{StandbyClientHandler}} itself. This is wrong, because {{StandbyClientHandler}} still needs its thread pool to execute some callbacks when the pipeline is emptied, i.e. "handlerRemoved".

I also simplified {{StandbyClientHandler#close}} because there is no need to empty the pipeline. As long as the thread pools are shut down, there should be no resource leak. This semplification also allowed to get rid of the {{ctx}} instance variable.

[~alex.parvulescu], can you validate the attached patch?

> Cold Standby intermittently throws RejectedExecutionException
> -------------------------------------------------------------
>
>                 Key: OAK-4058
>                 URL: https://issues.apache.org/jira/browse/OAK-4058
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: tarmk-standby
>            Reporter: Francesco Mari
>            Assignee: Francesco Mari
>             Fix For: 1.4
>
>         Attachments: OAK-4058.patch
>
>
> The Cold Standby subsystem very frequently catches and logs {{RejectedExecutionException}} instances thrown by Netty. These exceptions are most likely caused by an incorrect usage of the thread pools allocated by Netty.
> {noformat}
> 25.02.2016 09:23:02.517 *ERROR* [defaultEventExecutorGroup-1306-1] org.apache.jackrabbit.oak.plugins.segment.standby.client.SegmentLoaderHandler Exception caught, closing channel.
> java.util.concurrent.RejectedExecutionException: event executor terminated
> 	at io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:745)
> 	at io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:322)
> 	at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:728)
> 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:221)
> 	at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:75)
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:233)
> 	at io.netty.channel.AbstractChannelHandlerContext.access$400(AbstractChannelHandlerContext.java:32)
> 	at io.netty.channel.AbstractChannelHandlerContext$5.run(AbstractChannelHandlerContext.java:224)
> 	at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:36)
> 	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
> 	at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
> 	at java.lang.Thread.run(Thread.java:745)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)