jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Valentin Olteanu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OAK-6784) Exceptions are inhibited in oak-run compact
Date Thu, 05 Oct 2017 15:13:00 GMT

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

Valentin Olteanu commented on OAK-6784:
---------------------------------------

The same happens in {{oak-run-1.6.5}} so it might be worth backporting.

> Exceptions are inhibited in oak-run compact
> -------------------------------------------
>
>                 Key: OAK-6784
>                 URL: https://issues.apache.org/jira/browse/OAK-6784
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: run, segment-tar
>    Affects Versions: 1.7.8, 1.6.5
>            Reporter: Valentin Olteanu
>             Fix For: 1.8
>
>
> Exceptions thrown by {{oak-run compact}} are inhibited so the exit code of the command
is not correct in case of error. 
> Example: 
> {code}
> $ java -jar oak-run-1.7.8-R1809845.jar compact test-oak-run/
> Apache Jackrabbit Oak 1.7.8-R1809845
> Compacting test-oak-run-6.3.0
> With default access mode
>     before
>         Thu Oct 05 15:14:22 CEST 2017, journal.log
>         Thu Oct 05 15:14:23 CEST 2017, data00000a.tar
>         Thu Oct 05 15:14:23 CEST 2017, manifest
>         Thu Oct 05 15:14:23 CEST 2017, repo.lock
>     size 119.1 MB (119133142 bytes)
>     -> compacting
> org.apache.jackrabbit.oak.segment.file.InvalidFileStoreVersionException: Using a too
recent version of oak-segment-tar
> 	at org.apache.jackrabbit.oak.segment.file.ManifestChecker.checkStoreVersion(ManifestChecker.java:81)
> 	at org.apache.jackrabbit.oak.segment.file.ManifestChecker.checkManifest(ManifestChecker.java:70)
> 	at org.apache.jackrabbit.oak.segment.file.ManifestChecker.checkAndUpdateManifest(ManifestChecker.java:51)
> 	at org.apache.jackrabbit.oak.segment.file.FileStore.<init>(FileStore.java:191)
> 	at org.apache.jackrabbit.oak.segment.file.FileStoreBuilder.build(FileStoreBuilder.java:343)
> 	at org.apache.jackrabbit.oak.segment.tool.Compact.newFileStore(Compact.java:165)
> 	at org.apache.jackrabbit.oak.segment.tool.Compact.compact(Compact.java:135)
> 	at org.apache.jackrabbit.oak.segment.tool.Compact.run(Compact.java:128)
> 	at org.apache.jackrabbit.oak.run.SegmentTarUtils.compact(SegmentTarUtils.java:183)
> 	at org.apache.jackrabbit.oak.run.CompactCommand.execute(CompactCommand.java:93)
> 	at org.apache.jackrabbit.oak.run.Main.main(Main.java:49)
>     after
>         Thu Oct 05 15:14:22 CEST 2017, journal.log
>         Thu Oct 05 15:14:23 CEST 2017, data00000a.tar
>         Thu Oct 05 15:14:23 CEST 2017, manifest
>         Thu Oct 05 15:14:23 CEST 2017, repo.lock
>     size 119.1 MB (119133142 bytes)
>     removed files []
>     added files []
> Compaction succeeded in 211.9 ms (0s).
> {code}
> A quick fix would be to wrap the exception into a {{RuntimeException}}:
> {code}
> --- a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Compact.java
> +++ b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Compact.java
> @@ -127,7 +127,7 @@ public class Compact implements Runnable {
>          try {
>              compact();
>          } catch (Exception e) {
> -            e.printStackTrace();
> +            throw new RuntimeException("Failed to run compact", e);
>          }
>      }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message