Skip to content
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

Handle renaming a watched directory on Linux #193

Open
wolfs opened this issue Apr 24, 2020 · 4 comments
Open

Handle renaming a watched directory on Linux #193

wolfs opened this issue Apr 24, 2020 · 4 comments

Comments

@wolfs
Copy link
Member

wolfs commented Apr 24, 2020

Linux sends the 0x800 event (IN_MOVE_SELF), when renaming a watched directory. Currently, we treat that event as an unknown event. We could handle it as well as REMOVED/CREATED.

See this test:

def "can rename watched directory"() {
given:
def watchedDirectory = new File(rootDir, "watched")
watchedDirectory.mkdirs()
startWatcher(watchedDirectory)
when:
watchedDirectory.renameTo(new File(rootDir, "newWatched"))
waitForChangeEventLatency()
then:
if (Platform.current().linux) {
expectLogMessage(WARNING, Pattern.compile("Unknown event 0x800 for ${Pattern.quote(watchedDirectory.absolutePath)}"))
}
noExceptionThrown()
}

@lptr
Copy link
Member

lptr commented Aug 18, 2020

Is this still a problem? I think we've solved it, but not sure.

@wolfs
Copy link
Member Author

wolfs commented Aug 18, 2020

I don't think we addressed this.

So what happens is that we drop the VFS when the watched directory is renamed, because we receive an unknown event. I think this is fine.

@sergeykad
Copy link

This error still occurs with Gradle 7.4.2

Unknown event 0x800 for /home/ubuntu/workspace/
Received unknown event for /home/ubuntu/workspace/
Stopping file watching and invalidating VFS after an error happened
Daemon will be stopped at the end of the build after the daemon was no longer found in the daemon registry

@lazarillo
Copy link

And still with Gradle 8.2.1:

Unknown event 0x800 for /build/generated/source/proto/main/python/payment
Unknown event 0x800 for /build/generated/source/proto/main/python/order
Unknown event 0x800 for /build/generated/source/proto/main/python/shared
Received unknown event for /build/generated/source/proto/main/python/payment

BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed

My gradle details:

------------------------------------------------------------
Gradle 8.2.1
------------------------------------------------------------

Build time:   2023-07-10 12:12:35 UTC
Revision:     a38ec64d3c4612da9083cc506a1ccb212afeecaa

Kotlin:       1.8.20
Groovy:       3.0.17
Ant:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM:          17.0.6 (Eclipse Adoptium 17.0.6+10)
OS:           Linux 6.2.0-26-generic amd64

@lptr lptr removed the @execution label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants