maven-mvnd icon indicating copy to clipboard operation
maven-mvnd copied to clipboard

Package crashes due to java.io.IOException

Open JenniferCcy opened this issue 2 years ago • 2 comments

Hi there,

Before describing the issue I'm facing, my setup is as follow:

  mvnd 0.8.1 linux-amd64 native client (821c6a54a20ce4c4a2b94419334aaf125a128caf)
  Terminal: org.jline.terminal.impl.PosixSysTerminal with pty org.jline.terminal.impl.jansi.linux.LinuxNativePty
  Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
  Java version: 1.8.0_162, vendor: Oracle Corporation, runtime: /usr/local/jdk1.8.0_162/jre
  OS name: "linux", version: "3.10.0-1127.13.1.el7.x86_64", arch: "amd64", family: "unix"

I userd mvnd to built the modules on Jenkins concurrently. The command is "mvnd -Dmaven.settings=/home/jenkins/.m2/settings.xml -Dmaven.legacyLocalRepo=true clean package -T3",sometime it works well,but sometime it crashed. The error is as follows:

Purged 2 log files (log available in /home/jenkins/.m2/mvnd/registry/0.8.1/purge-2022-10-08.log)
Exception in thread "main" java.lang.RuntimeException: java.io.IOException: Stream closed
        at org.mvndaemon.mvnd.common.logging.TerminalOutput.update(TerminalOutput.java:526)
        at org.mvndaemon.mvnd.common.logging.TerminalOutput.accept(TerminalOutput.java:200)
        at org.mvndaemon.mvnd.client.DefaultClient.execute(DefaultClient.java:352)
        at org.mvndaemon.mvnd.client.DefaultClient.main(DefaultClient.java:131)
Caused by: java.io.IOException: Stream closed
        at java.io.BufferedWriter.ensureOpen(BufferedWriter.java:107)
        at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:117)
        at java.io.BufferedWriter.flush(BufferedWriter.java:256)
        at org.mvndaemon.mvnd.common.logging.TerminalOutput$FileLog.flush(TerminalOutput.java:858)
        at org.mvndaemon.mvnd.common.logging.TerminalOutput.update(TerminalOutput.java:524)
        ... 3 more

If you need more elements to help with the issue, just let me know. Thanks a lot for any help.

JenniferCcy avatar Oct 09 '22 08:10 JenniferCcy

I resovled the problem by adding -Dmvnd.logPurgePeriod=999999d in the command.

JenniferCcy avatar Oct 19 '22 13:10 JenniferCcy

This is unexpected. The purge process should only remove files that have a last modified time earlier than the current date minus the purge period (which defaults to 7 days). So this should not affect daemons that are still alive. The exception however seems to indicate that the log file of a live daemon has been deleted...

gnodet avatar Jan 24 '23 13:01 gnodet