-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Check for additional file events in watch event poll #12384
Conversation
Signed-off-by: Vladyslav Zhukovskyi <vzhukovs@redhat.com>
ci-test |
Results of automated E2E tests of Eclipse Che Multiuser on OCP: |
ci-build |
Selenium tests execution on Eclipse Che Multiuser on OCP (https://ci.codenvycorp.com/job/che-pullrequests-test-ocp/1408/) doesn't show any regression against this Pull Request. |
@@ -269,33 +270,35 @@ private void run() { | |||
continue; | |||
} | |||
|
|||
List<WatchEvent<?>> watchEvents = watchKey.pollEvents(); | |||
for (List<WatchEvent<?>> watchEvents = watchKey.pollEvents(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe while
statement here make code more readable ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean something like this?:
List<WatchEvent<?>> watchEvents = watchKey.pollEvents();
while(!watchEvents.isEmpty()) {
if (suspended.get()) {
...
}
for (WatchEvent<?> event : watchEvents) {
...
}
watchEvents = watchKey.pollEvents();
}
Signed-off-by: Vladyslav Zhukovskyi <vzhukovs@redhat.com>
ci-build |
Signed-off-by: Vladyslav Zhukovskyi <vzhukovs@redhat.com>
ci-build |
What does this PR do?
This changes proposal adds fix for the problem related to sequential handling file watcher events. The problem is in mechanism of receiving events: https://github.com/eclipse/che/blob/master/wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/watcher/server/impl/FileWatcherService.java#L272. We try to get events and continue work with them but we don't check that in this moment we can receive additional events.
Use case to reproduce such problem: use git repository with the following structure:
clone this repo into che and make outside operation to make the following structure:
file watcher detects changes and we call https://github.com/eclipse/che/blob/master/wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/watcher/server/impl/FileWatcherService.java#L272 we receive two events about delete
file1
anddir
, but in a moment we receive rest two events that is not handled forfile2
andfile3
.Signed-off-by: Vladyslav Zhukovskyi vzhukovs@redhat.com
What issues does this PR fix or reference?
#11648
Release Notes
N/A
Docs PR
N/A