apache / apache/maven-mvnd

Daemon process stops

Open
#624 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.5k
Forks
250
Avg merge
16h 22m
Merged PRs (30d)
36

Description

mvnd version: 0.8.0

```
09:04:15.324 I Dispatch message: ProjectLogMessage{projectId='xxxxxxxxxxxxxxxx', message='[INFO] [stdout] Generating code...'}
09:04:15.324 D Expiration check running
09:04:15.341 D Storing daemon stop event: after the daemon was no longer found in the daemon registry
09:04:15.329 E Error dispatching events
org.mvndaemon.mvnd.common.DaemonException$RecoverableMessageIOException: Could not write message ProjectLogMessage{projectId='xxxxxxxxxxxxxxxx', message='[INFO] [stdout] Generating code...'} to '/127.0.0.1:49960'.
at org.mvndaemon.mvnd.common.DaemonConnection.dispatch(DaemonConnection.java:116)
at org.mvndaemon.mvnd.daemon.Server.lambda$handle$3(Server.java:500)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
at sun.nio.ch.IOUtil.write(IOUtil.java:51)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:470)
at org.mvndaemon.mvnd.common.DaemonConnection$SocketOutputStream.writeWithNonBlockingRetry(DaemonConnection.java:275)
at org.mvndaemon.mvnd.common.DaemonConnection$SocketOutputStream.writeBufferToChannel(DaemonConnection.java:263)
at org.mvndaemon.mvnd.common.DaemonConnection$SocketOutputStream.flush(DaemonConnection.java:257)
at java.io.DataOutputStream.flush(DataOutputStream.java:123)
at org.mvndaemon.mvnd.common.DaemonConnection.dispatch(DaemonConnection.java:113)
... 2 common frames omitted
09:04:15.351 I Daemon will be stopped at the end of the build after the daemon was no longer found in the daemon registry
09:04:15.390 D Stop as soon as idle requested. The daemon is busy.
09:04:15.390 I Updating state to: StopRequested
09:04:15.402 D daemon stop has been requested. Sleeping until state changes.
09:04:25.311 D Expiration check running
09:04:33.671 I Build finished, finishing message dispatch
09:04:33.671 I Daemon back to idle
09:04:33.671 I Updating state to: Idle
09:04:36.324 D daemon is running. Sleeping until state changes.
09:04:36.324 D Expiration check running
09:04:36.331 D Storing daemon stop event: other compatible daemons were started and after being idle for 4m54s277ms and not recently used
09:04:36.332 I Daemon will be stopped at the end of the build other compatible daemons were started and after being idle for 4m54s277ms and not recently used
09:04:36.333 D Marking daemon stopped due to other compatible daemons were started and after being idle for 4m54s277ms and not recently used. The daemon is running a build: false
09:04:36.333 I Updating state to: Stopped
09:04:36.334 D daemon has stopped.
09:04:36.339 E Error running daemon loop
java.nio.channels.AsynchronousCloseException: null
at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:205)
at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:256)
at org.mvndaemon.mvnd.daemon.Server.accept(Server.java:223)
at java.lang.Thread.run(Thread.java:748)
```

Follow up issue to the discussion in https://github.com/apache/maven-mvnd/issues/500#issuecomment-1111919636

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the mvnd 0.8.0 daemon-stop sequence from the issue logs, then read org.mvndaemon.mvnd.daemon.Server.java around accept and handle, and org.mvndaemon.mvnd.common.DaemonConnection.java around dispatch. Trace the Broken pipe and AsynchronousCloseException through the daemon lifecycle; done means the reported stop sequence is handled without the daemon loop error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.