Server chokes on blocks placed by fake players in 1.7.10
Techjar opened this issue ยท 5 comments
I looked at VisualVM and it showed ProtectedUtil.getOwnerIdentity() (which makes an HTTP request) being called a lot, so I made a test build to find out why. Turns out it was trying to look up fake player names like "ComputerCraft", and since it never gets a response it does a lookup for every single block with that name. This causes the server to freeze for an extended period of time.
My proposed solution would be to cache them as null, so it knows not to look it up again, and handle non-UUID owner values.
EDIT: After further analyzation of the protection code, I have determined that it is completely broken. You are comparing the object's UUID to its own UUID, which is of course always going to return true.
The system works just fine for my local tests, but I do see that it isn't caching null responses. I've added the missing code, but I'm not sure which part you're saying is broken. Like I said, I've debugged converting my old name to the new UUID system and it works and caches the response exactly as it should.
in ProtectedUtil.isOwner(), you're never retrieving the UUID from the actual player, and instead just comparing the object to itself.
If you'd like to build and let me know your results it would be helpful. I tested against null cases and also verified that only a single HTTP request is made per user.
I actually made the same changes on my local copy and tested that, lo and behold no more extended freezing issues.