-
-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BuildInfo
fails to write the same file twice
#1711
Comments
This is strange. The |
I've seen something like this when running tests. My was complaining that a file in the
I don't think it is an error with I've also seen GUI processes stay alive when I Ctrl-C in the Sorry that is a bit vague but it happen very often. I'm on MacOS x86 |
We should collect as much context as possible here. Two changes come to my mind that we made during 0.10 develoment, that may be related:
Your both issues might be still unrelated though. |
I'm pretty sure it's Ctrl-C related and when using If I run: package milltest
object MillTest extends App {
var i = 0
val pid = ProcessHandle.current().pid()
val testDir = os.pwd / "test"
os.makeDir.all(testDir)
while(true) {
println(s"running: $i")
i += 1
os.remove(testDir / s"TestFile-$pid-${i-1}.txt")
os.write.over(testDir / s"TestFile-$pid-$i.txt", "")
Thread.sleep(100)
}
} via
And then Ctrl-C you can see the process still running in the background with This is under MacOS. I hope this helps. |
I also have been experiencing some general instability, like this issue that I reported. |
This touched how |
Could also be some change in Ammonite or in how we use Ammonite, especially regarding caching. This hit use previously (in the very low versions). When Ammonite decides to use an older or incorrect cached version, any kind of strange behavior can be observed. |
FTR, I tried to use |
What OS are you on? I get these problems on MacOS but that's the only place I run mill interactively |
The reproduction here works very well in my setup. You will not see the logs of the processes because the streams are disconnected but they are in the background doing work. EDIT: When I say work I mean that the problem exists and I can see it thanks to the reproduction. |
My env:
@lolgab Thanks for pointing it out. I'll try it. |
I can't not reproduce the OP issue, but I can see, that Mill is keeping the spawned test process alive after shutting down itself. This is something I though I've fixed when I implemented the sutdown hook in |
I strongly think, this is an issue with
So, instead of stopping compilation at around progress 681 of 2049, it continued compiling in the background. I've not checked, but this could also result in the appearance of more than one running mill server process ( |
There definitely seems to be some sort of miscommunication from the server to the client regarding termination. For example if you write a program: object MillTest extends App {
(1 to 100000).foreach{ i =>
println(i)
}
} in a
the file [If you think this is unrelated I am happy to open it as its own issue] |
I've hit this reproducibly when I've had multiple Mill processes running, e.g. one in Mill doesn't have a formal concurrency model w.r.t. multiple Mill processes running over the same targets at the same time, so it makes sense it could misbehave. |
Going to call this hopefully fixed by @alexarchambault 's work adding a coarse grained lock around the out folder |
It seems
BuildInfo
usesos.write
when it should useos.write.over
.The text was updated successfully, but these errors were encountered: