jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrei Dulceanu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OAK-7838) oak-run check crashes JVM
Date Tue, 30 Oct 2018 11:27:00 GMT

    [ https://issues.apache.org/jira/browse/OAK-7838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16668577#comment-16668577
] 

Andrei Dulceanu commented on OAK-7838:
--------------------------------------

[~mduerig], I like the idea. The proposed changes look good to me.

> oak-run check crashes JVM
> -------------------------
>
>                 Key: OAK-7838
>                 URL: https://issues.apache.org/jira/browse/OAK-7838
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: run, segment-tar
>            Reporter: Michael Dürig
>            Assignee: Andrei Dulceanu
>            Priority: Major
>             Fix For: 1.10
>
>
> I had a case where running {{oak-run check}} on a repository with many revisions would
reliably crash the JVM. 
> Apparently there is a problem with the {{Scheduler}} instances in {{org.apache.jackrabbit.oak.segment.CommitsTracker}}:
when many instances of that class are created in fast succession it will leave many daemon
threads lingering around for a while. In my case this was sufficient to kill the JVM. 
> To verify I simply removed the scheduler and everything was just fine:
> {code}
> ===================================================================
> --- oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/CommitsTracker.java
   (date 1539358293000)
> +++ oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/CommitsTracker.java
   (date 1539670356000)
> @@ -19,8 +19,6 @@
> package org.apache.jackrabbit.oak.segment;
> -import static java.util.concurrent.TimeUnit.MINUTES;
> -
> import java.io.Closeable;
> import java.util.HashMap;
> import java.util.Map;
> @@ -29,7 +27,6 @@
> import java.util.stream.Stream;
> import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap;
> -import org.apache.jackrabbit.oak.segment.file.Scheduler;
> /**
>  * A simple tracker for the source of commits (writes) in
> @@ -49,7 +46,6 @@
>     private final ConcurrentMap<String, Long> commitsCountPerThreadGroup;
>     private final ConcurrentMap<String, Long> commitsCountOtherThreads;
>     private final ConcurrentMap<String, Long> commitsCountPerThreadGroupLastMinute;
> -    private final Scheduler commitsTrackerScheduler = new Scheduler("CommitsTracker
background tasks");
>     CommitsTracker(String[] threadGroups, int otherWritersLimit, boolean collectStackTraces)
{
>         this.threadGroups = threadGroups;
> @@ -60,8 +56,6 @@
>                 .maximumWeightedCapacity(otherWritersLimit).build();
>         this.queuedWritersMap = new ConcurrentHashMap<>();
> -        commitsTrackerScheduler.scheduleWithFixedDelay("TarMK commits tracker stats
resetter", 1, MINUTES,
> -                this::resetStatistics);
>     }
>     public void trackQueuedCommitOf(Thread t) {
> @@ -112,7 +106,7 @@
>     @Override
>     public void close() {
> -        commitsTrackerScheduler.close();
> +
>     }
> {code}
> cc [~dulceanu]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message