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

Null Pointer Exceptions for Zone fields occuring during Campaign Load and Auto Save #1267

Closed
cwisniew opened this issue Feb 9, 2020 · 1 comment
Assignees
Labels
bug tested This issue has been QA tested by someone other than the developer. thread-safety Thread Safety Issues that need to be addressed

Comments

@cwisniew
Copy link
Member

cwisniew commented Feb 9, 2020

Describe the bug
During both Campaign Load and Auto Save a null pointer exception occurs some times when the Zone is accessing its fields. This is due to the inherent lack of thread safety in Campaign/Zone/(you could keep going most of the way down) which results in other threads "seeing these fields before seeing the completion of initialisation of these objects".

While this is down to the the lack of thread safety in these classes the code for auto saving has comments saying that because the copy happens on EDT it is safe. This comment is completely incorrect, this does nothing to address the threading issues at all. For clarity sake multithreading issues/bugs are not just limited to concurrent access issues but also encompass state visibility.

While there is a larger issue of how exactly state persistence should work in a threaded environment where state can change during the saving process to be had (I have created issues #1263 and #1264 for this). A shorter term solution is also required to address the null pointer/incomplete object initialization problem.

@cwisniew cwisniew added bug thread-safety Thread Safety Issues that need to be addressed labels Feb 9, 2020
@cwisniew cwisniew self-assigned this Feb 9, 2020
@Phergus Phergus added the tested This issue has been QA tested by someone other than the developer. label Mar 3, 2020
@Phergus
Copy link
Contributor

Phergus commented Mar 3, 2020

Tested. Previous test cases no longer produce NPEs. Closing.

@Phergus Phergus closed this as completed Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug tested This issue has been QA tested by someone other than the developer. thread-safety Thread Safety Issues that need to be addressed
Projects
None yet
Development

No branches or pull requests

2 participants