apache / apache/netbeans

NB can't stop processes which are running as children of reused mvnd daemons

Open
#7,676 3 comments 0 reactions 0 assignees View on GitHub
GraalVM kind:bug Maven
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 22

### What happened

There is some support for mvnd since NB 13 (https://github.com/apache/netbeans/pull/3210) and generally works ok for common build tasks.

However, the stop button can cause problems under some circumstances. It terminates the process tree, the JVM may not be in the tree of the mvnd process though (unless it runs for the first time and is not a reused daemon yet). Pressing stop will kill the mvnd process (which is sometimes just the client), but the "build" will continue running in the daemon.

what works:
- pressing build, run etc and never pressing stop (let everything exit naturally)
- killing the child JVM via shell will also work since it will cause "regular" shutdown
- pressing run while having no mvnd daemons active -> stop will work since it kills the whole process tree which still includes the daemon (it seems to detach once idle)

what doesn't work / reproducer:
1) press build and wait till it finishes (there is now a daemon available)
2) press run (program runs as child of the daemon, the mvnd client process won't have any children)
3) press stop (this will kill the mvnd client process only, rest will continue running)

workaround:
run `mvnd --stop` _before_ starting tasks where you expect to press stop, or clean up the processes periodically

### Language / Project Type / NetBeans Component

java maven project

### How to reproduce

see above

### Did this work correctly in an earlier version?

No / Don't know

### Operating System

linux

### JDK

22.0.2, Temurin

### Apache NetBeans packaging

Apache NetBeans binary zip

### Anything else

_No response_

### Are you willing to submit a pull request?

Yes (likely upstream)

Contributor guide

Open the contributing guide

Research direction

Start with the NetBeans Maven integration entry points used by the Build, Run, and Stop actions, then reproduce the sequence with a reused mvnd daemon on Linux. Trace how the stop action identifies the process tree when the mvnd client has no children. Done means stopping a running task also terminates its child JVM after the daemon has been reused.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.