mill icon indicating copy to clipboard operation
mill copied to clipboard

NumberFormatException when parsing process ID

Open He-Pin opened this issue 2 weeks ago • 8 comments

2025-12-10T05:57:58Z Read PID exception: java.lang.NumberFormatException: For input string: "pid37060"
2025-12-10T05:57:58Z The daemon lock is not available, there is already a server running.
2025-12-10T05:57:58Z Trying to read the process ID of a running daemon from /Users/hepin/IdeaProjects/sjsonnet/out/mill-daemon/processId

run ./mill __.runRegressions on sjsonnet 0.5.5 branch and then switch back to main , run ./mill __.runRegressions again.

He-Pin avatar Dec 10 '25 05:12 He-Pin

@He-Pin please help me minimize a repro

lihaoyi avatar Dec 10 '25 08:12 lihaoyi

@lihaoyi I'm using the sjsonnet repo, I fixed it with rm -rf .out. I think that's because the process ID format has changed between mill 0.12.x and 1.1.x.

He-Pin avatar Dec 10 '25 08:12 He-Pin

Is this exception in Mill 0.12 or 1.x? Even if the format changed, reading the file should gracefully handle any errors or provide a high level error message.

lefou avatar Dec 10 '25 08:12 lefou

1.1.x。

He-Pin avatar Dec 10 '25 09:12 He-Pin

Probably going to call this a wontfix if it requires swapping between versions to reproduce

lihaoyi avatar Dec 10 '25 10:12 lihaoyi

A simple fix would be to catch the exception and drop the pid for another try.

He-Pin avatar Dec 10 '25 11:12 He-Pin

IIUC, Mill will not recover from this kind of failure, as long as the PID file exists. Since we can foresee this situation, and it is more or less self-induced (we want users to switch to newer versions), we should either handle it or report an actionable message to the user.

lefou avatar Dec 10 '25 12:12 lefou

Yeah, maybe with a better error report, and point user to delete the out folder.

He-Pin avatar Dec 10 '25 12:12 He-Pin