Skip to content

os: error return by os.RemoveAll is not compatible with os.IsNotExist #7776

@davecheney

Description

@davecheney
What steps will reproduce the problem?
1. http://play.golang.org/p/2oDie7N4Hd

What is the expected output? What do you see instead?

Expected: the workers race to delete the directory tree, there is a high probability
that some will race to delete a directory that has already been deleted. In that case
os.IsNotExist() should identify the error

Got:

lucky(~/devel/issue) % go run issue.go 
2014/04/14 11:07:18 creating temporary directories rooted at
"/tmp/issue866430634"
2014/04/14 11:07:18 preparing workers
2014/04/14 11:07:18 release the swarm
2014/04/14 11:07:19 unexpected error: *os.SyscallError, "readdirent: no such file
or directory"
2014/04/14 11:07:19 unexpected error: *os.SyscallError, "readdirent: no such file
or directory"
2014/04/14 11:07:19 unexpected error: *os.SyscallError, "readdirent: no such file
or directory"

Please use labels and text to provide additional information.

Because syscall.ENOENT is wrapped in an *os.SyscallError the check in error_unix.go
fails.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions