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

NPE while using //replace #1089

Closed
2 tasks done
Nishh opened this issue May 22, 2021 · 1 comment · Fixed by #1030
Closed
2 tasks done

NPE while using //replace #1089

Nishh opened this issue May 22, 2021 · 1 comment · Fixed by #1030
Labels
Approved Added if an issue has been approved by a maintainer Bug Something isn't working

Comments

@Nishh
Copy link

Nishh commented May 22, 2021

Server Implementation

Paper

Server Version

1.16.5

Describe the bug

NPE error in console

To Reproduce

Select a big area and do //replace

Expected behaviour

No errors

Screenshots / Videos

No response

Error log (if applicable)

https://paste.gg/p/anonymous/26d7285c82e042dda7e0b977c40c913d

Fawe Debugpaste

https://athion.net/ISPaster/paste/view/b2772ee63e2a49c6896cb578e5fcc5a1

Fawe Version

1.16-688;71f7103

Checklist

Anything else?

It only happens sometimes, not always.
I'm using default config (fawe)

@Nishh Nishh added the Requires Testing This is a new issue which needs to be approved before labeled with "bug" label May 22, 2021
@NotMyFault NotMyFault added Approved Added if an issue has been approved by a maintainer Bug Something isn't working Under investigation and removed Requires Testing This is a new issue which needs to be approved before labeled with "bug" labels May 22, 2021
@MattBDev
Copy link
Contributor

Looks like our threads aren't playing nice again.

dordsor21 added a commit that referenced this issue Jun 8, 2021
**Add a null-check to CharBlocks FULL section layer-retrieval.**
 - It is possible to trim CharBlocks whilst it is attempting to read data due to the batching of chunks to help reduce memory
 - This is done when the number of chunks sitting loaded in memory with having been "submitted" to the queue for writing to disk becomes high
 - Seconday operations such as heightmap processing and lighting will quickly load chunks, meaning many chunks are submitted early
 - This leads to much higher chances of the chunk being submitted and subsequently trimmed given heightmap and light processing is done layer-by-layer over many chunks, rather than chunk-by-chunk - thus leading to NPEs.
 - By adding synchronisation to and around only the specific sections when loading/updating, and not blocking the whole chunk, many access can still be thread-safe without causing deadlocks
 - This allows removal of lots of the needless and very-slowing synchronisation on get**Block** methods

**Remove much of the synchronisation from ChunkHolder**
 - We shouldn't be synchronising with call() and safety should be added elsewhere. (plus it's making edits very very slow when queue target size is hit)
 - Also remove much of synchronisation because we've added the null-check and section-specific synchronisation to CharBlocks
 
**Some QOL/thread-safe data access changes**
- Replaces the Array#clone seen in the get blocks classes with System#arraycopy as deep cloning is not required, and is also slower than arraycopy
- Add System#arraycopy when accessing chunk section data via history to ensure it is not altered whilst being written
- Renaming EMPTY to empty means it is not implied to be a static variable

Fixes #1028
Fixes #1025
Fixes #1089
Fixes #1091
Fixes #1097
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Added if an issue has been approved by a maintainer Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants