Community
Participate
Working Groups
I am pretty sure, the behavior changed in 4.17. I had a hard night trying to figure out a solution. When IResource.refreshLocal() is run from within a Job, it needs to be synchronous or at least there needs to be a synchronous variant to be called. If I have a Job, that updates some resources (not through the API, but on the filesystem) and I have to refresh that resource, the refresh is actually performaed AFTER my Job has finished and all other Jobs, that were in the queue before my call to refreshLocal(). This can be pretty hard. I need the resource to be in sync right at this time. I already tried to split up my Job, but this didn't do the trick. I made this bug a blocker, because it really is for me.
Please provide a standalone reproducible example project / test case.
(In reply to Marvin Fröhlich from comment #0) > I am pretty sure, the behavior changed in 4.17. IResource.refreshLocal() and its implementation have no changes in 4.17. Most recent (and unrelated) changes were in 4.14. So whatever problem you have is probably coming from somewhere else - please provide a reproducer so we can check what is actually causing troubles.
Ok, I will do that. But before I do, can you confirm, that refreshLocal() does not start working before the last Job is done, that was in the queue before that call? And is there a way around it? I know, this is not a support forum. But if the above is true, this is clearly something to be fixed.
(In reply to Marvin Fröhlich from comment #3) > Ok, I will do that. But before I do, can you confirm, that refreshLocal() > does not start working before the last Job is done, that was in the queue > before that call? refreshLocal() doesn't know anything about any jobs, it uses workspace locks. So I can't confirm anything without a code example.
Looks like it's not the refreshLocal(), which is delayed after the last Job, but the resource change event is.
I helper myself with a small threshold. Not a good solution, but a workaround.
New Gerrit change created: https://git.eclipse.org/r/c/cdt/org.eclipse.cdt/+/169968
New Gerrit change created: https://git.eclipse.org/r/c/cdt/org.eclipse.cdt/+/170015
New Gerrit change created: https://git.eclipse.org/r/c/cdt/org.eclipse.cdt/+/170109