Bug 571133

Summary: NPE in FileSystemResourceManager
Product: [Eclipse Project] Platform Reporter: Jörg Kubitz <jkubitz-eclipse>
Component: ResourcesAssignee: Platform-Resources-Inbox <platform-resources-inbox>
Status: NEW --- QA Contact:
Severity: minor    
Priority: P3 CC: mistria
Version: 4.20   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/c/platform/eclipse.platform.resources/+/176136
https://git.eclipse.org/c/platform/eclipse.platform.resources.git/commit/?id=bb74d4c7ac103c87dfdef68b4189584bc6b7abac
https://git.eclipse.org/r/c/platform/eclipse.platform.resources/+/176250
https://git.eclipse.org/r/c/platform/eclipse.platform.resources/+/178395
https://git.eclipse.org/c/platform/eclipse.platform.resources.git/commit/?id=2fef0814c893d3f766abea81bbe32d09fdfa337e
Whiteboard:

Description Jörg Kubitz CLA 2021-02-11 12:32:25 EST
was: Bug 541493 - NPE after assertNotNull in FileSystemResourceManagerTest

java.lang.NullPointerException
	at org.eclipse.core.internal.localstore.FileSystemResourceManager.updateLocalSync(FileSystemResourceManager.java:1094)
	at org.eclipse.core.internal.localstore.FileSystemResourceManager.write(FileSystemResourceManager.java:1182)
	at org.eclipse.core.tests.internal.localstore.FileSystemResourceManagerTest$WriteFileContents.run(FileSystemResourceManagerTest.java:511)
...
Comment 1 Eclipse Genie CLA 2021-02-11 12:39:49 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.resources/+/176136
Comment 2 Mickael Istria CLA 2021-02-11 16:01:25 EST
So the idea is to replace a NullPointerException by an IllegalStateException, or is there more substance/fix?
Comment 3 Jörg Kubitz CLA 2021-02-11 16:04:52 EST
To introduce a better exception is only a workaround. If someone would find the root reason why that state sometimes(!) happens on jenkins would help. until now nobody could even find the error since the exception was missing.
Comment 4 Jörg Kubitz CLA 2021-02-12 03:28:03 EST
The error is reproducable in FileSystemResourceManagerTest.testWriteFile()
see
https://ci.eclipse.org/platform/job/eclipse.platform.resources-Gerrit/1503/testReport/junit/org.eclipse.core.tests.internal.localstore/AllTests/testWriteFile/

Ther error happens when the asynchronous workplace refresh thread detects that the "file" was deleted and marking it with DataTreeLookup.isPresent=false. When then (Race condition) the test tries to write into that file it fails because isPresent==false.
If the test is faster then the workplace refresh no error is thrown.

I dont know enough about that test. So i cannot say if the test is wrong or if there is a problem in the productive code.

Someone knows what behaviour that is intended there?

I just was confused that this test randomly invalidated another commit.
Comment 6 Eclipse Genie CLA 2021-02-15 01:56:01 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.resources/+/176250
Comment 7 Eclipse Genie CLA 2021-03-25 18:59:11 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.resources/+/178395