sbt / io

IO module for sbt
Apache License 2.0
40 stars 46 forks source link

retry on all FileSystemException in IO.createDirectory #296

Closed eed3si9n closed 4 years ago

eed3si9n commented 4 years ago

Fixes https://github.com/sbt/io/issues/295

eatkins commented 4 years ago

I think this api is badly documented, which is my fault. I’m not sure that your change does what it looks like it does. The excluded exceptions are the exceptions that will not cause a retry. So the reason this did not retry on FileNotFoundException was so I could avoid a call to Files.isDirectory. Expanding the excluded exceptions list expands the list of exceptions that won’t induce a retry which I think is the opposite of what we want for #295.

eed3si9n commented 4 years ago

O darn. I assumed that it was throwing immediately because I saw java.nio.file.AccessDeniedException before this change (#295). So if it was capturing AccessDeniedException before, did it go over the retry limit?

eed3si9n commented 4 years ago

Reverting this in https://github.com/sbt/io/pull/297

eatkins commented 4 years ago

Yeah, it should have hit the retry limit. I think AccessDeniedExceptions can be really tough in scripted because there are multiple processes modifying files in the same directories. Windows is much more protective of files than posix systems.