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

Michael Dürig commented on OAK-5135:
------------------------------------

Forcing shut down of the scheduler *might* introduce another regression: 
interrupting threads can cause underlying resourced to be closed. If this 
happens there is still changes we see ugly stack traces. (Data loss shouldn't 
be a concern though). 

I would have preferred to just increase the time out. If the flush thread takes 
longer than 60 seconds (the current time out before attempting to interrupt the 
threads) to finish then there is most likely something wrong with that one. 

> The flush of written data via TarRevisions is asynchronous in relation to 
> FileStore.close()
> -------------------------------------------------------------------------------------------
>
>                 Key: OAK-5135
>                 URL: https://issues.apache.org/jira/browse/OAK-5135
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: segment-tar
>    Affects Versions: 1.5.13
>            Reporter: Arek Kita
>            Assignee: Francesco Mari
>            Priority: Critical
>             Fix For: 1.6, 1.5.15
>
>
> *Expected behavior*: {{FileStore.close()}} should wait for any written data 
> to be flushed to disk
> *Actual behavior*: {{FileStore.close()}} does not wait for flushing data
> {code:title=Migration log}
> 21.11.2016 12:00:59.792 WARN   o.a.j.o.s.f.Scheduler: The scheduler FileStore 
> background tasks takes too long to shutdown
> 21.11.2016 12:01:10.363 INFO   o.a.j.o.s.f.FileStore: TarMK closed: 
> /data/cq/crx-quickstart/repository-segment-tar-20161121-120039/segmentstore
> 21.11.2016 12:01:10.625 INFO   o.a.j.o.p.s.f.FileStore: TarMK closed: 
> /data/cq/crx-quickstart/repository/segmentstore
> ...
> ### The above directories are swapped/moved here etc ###
> ...
> 21.11.2016 12:01:10.646 WARN   o.a.j.o.s.f.FileStore: Failed to flush the 
> TarMK at 
> /data/cq/crx-quickstart/repository-segment-tar-20161121-120039/segmentstore
> java.io.IOException: Stream Closed
>     at java.io.RandomAccessFile.writeBytes(Native Method) ~[na:1.8.0_101]
>     at java.io.RandomAccessFile.writeBytes(RandomAccessFile.java:1100) 
> ~[na:1.8.0_101]
>     at 
> org.apache.jackrabbit.oak.segment.file.TarRevisions.flush(TarRevisions.java:209)
>  
>     at 
> org.apache.jackrabbit.oak.segment.file.FileStore.flush(FileStore.java:358) 
>     at 
> org.apache.jackrabbit.oak.segment.file.FileStore$2.run(FileStore.java:221) 
>     at 
> org.apache.jackrabbit.oak.segment.file.SafeRunnable.run(SafeRunnable.java:67) 
>     at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> [na:1.8.0_101]
>     at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) 
> [na:1.8.0_101]
>     at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
>  [na:1.8.0_101]
>     at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
>  [na:1.8.0_101]
>     at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>  [na:1.8.0_101]
>     at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>  [na:1.8.0_101]
>     at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
> {code}



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

Reply via email to