You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Started seeing this when working on a new project. Pretty trivial single-module Scala build. Mill 0.11.x. Not sure why I've never seen it before elsewhere, but it seems pretty frequent (happens several times a day). Using Intellij BSP.
Not sure what the ~ is at the end of /Users/lihaoyi/Github/usql/test/src/MainTests.scala~. Maybe some kind of temporary file IntelliJ/IntelliJ-BSP is creating and deleting quickly, cause a TOCTTOU race condition?
Watching for changes to 11 paths and 4 other values... (Enter to re-run, Ctrl-C to exit)
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at mill.main.client.IsolatedMillMainLoader.runMain(IsolatedMillMainLoader.java:58)
at mill.main.client.MillClientMain.main(MillClientMain.java:64)
Caused by: java.nio.file.NoSuchFileException: /Users/lihaoyi/Github/usql/test/src/MainTests.scala~
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.readAttributes(UnixFileAttributeViews.java:257)
at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.readAttributes(UnixFileAttributeViews.java:168)
at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:148)
at java.base/java.nio.file.Files.readAttributes(Files.java:1851)
at java.base/java.nio.file.Files.getPosixFilePermissions(Files.java:2125)
at os.perms$.apply(PermsOps.scala:13)
at mill.api.PathRef$.$anonfun$apply$3(PathRef.scala:131)
at mill.api.PathRef$.$anonfun$apply$3$adapted(PathRef.scala:124)
at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:576)
at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:574)
at scala.collection.AbstractIterable.foreach(Iterable.scala:933)
at scala.collection.IterableOps$WithFilter.foreach(Iterable.scala:903)
at mill.api.PathRef$.apply(PathRef.scala:124)
at mill.api.PathRef.recomputeSig(PathRef.scala:23)
at mill.util.Watchable$Path.poll(Watchable.scala:21)
at mill.util.Watchable.validate(Watchable.scala:15)
at mill.util.Watchable.validate$(Watchable.scala:15)
at mill.util.Watchable$Path.validate(Watchable.scala:20)
at mill.runner.Watching$.$anonfun$statWatchWait$1(Watching.scala:75)
at mill.runner.Watching$.$anonfun$statWatchWait$1$adapted(Watching.scala:75)
at scala.collection.immutable.List.forall(List.scala:386)
at mill.runner.Watching$.statWatchWait0$1(Watching.scala:75)
at mill.runner.Watching$.statWatchWait(Watching.scala:98)
at mill.runner.Watching$.watchAndWait(Watching.scala:67)
at mill.runner.Watching$.watchLoop(Watching.scala:45)
at mill.runner.MillMain$.$anonfun$main0$1(MillMain.scala:198)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
at scala.Console$.withErr(Console.scala:193)
at mill.api.SystemStreams$.$anonfun$withStreams$2(SystemStreams.scala:62)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
at scala.Console$.withOut(Console.scala:164)
at mill.api.SystemStreams$.$anonfun$withStreams$1(SystemStreams.scala:61)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
at scala.Console$.withIn(Console.scala:227)
at mill.api.SystemStreams$.withStreams(SystemStreams.scala:60)
at mill.runner.MillMain$.main0(MillMain.scala:80)
at mill.runner.MillMain$.main(MillMain.scala:58)
at mill.runner.MillMain.main(MillMain.scala)
... 6 more
The text was updated successfully, but these errors were encountered:
If it's some temporary file, we should ignore it when collecting source files. We already apply a filter to exclude linux hidden files starting with a dot.
Ignoring specific files won't help, because the crash comes when checking the PathRef signature for the entire src/ folder, before we have chance to filter individual files
We could add some smartness to PathRef to provide some way of pre-filtering things, but for now we should just make it robust and fail a bit more elegantly in the face of concurrent updates
…ons (#2832)
Attempts to fix#2808
No real tests; the failure is timing-dependent and hard to reproduce.
But hopefully just wrapping everything up in a big try-catch will fix it
Pull request: #2832
Started seeing this when working on a new project. Pretty trivial single-module Scala build. Mill 0.11.x. Not sure why I've never seen it before elsewhere, but it seems pretty frequent (happens several times a day). Using Intellij BSP.
Not sure what the
~
is at the end of/Users/lihaoyi/Github/usql/test/src/MainTests.scala~
. Maybe some kind of temporary file IntelliJ/IntelliJ-BSP is creating and deleting quickly, cause a TOCTTOU race condition?The text was updated successfully, but these errors were encountered: