Bug 571133 - NPE in FileSystemResourceManager
Summary: NPE in FileSystemResourceManager
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 4.20   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Platform-Resources-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-11 12:32 EST by Jörg Kubitz CLA
Modified: 2021-03-26 02:53 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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