PreciousStones

PreciousStones

269k Downloads

Server Crashes... Thread-Safe Violations?

kbryant opened this issue ยท 14 comments

commented

Very recently my server has been intermittently and randomly crashing. The symptoms are very similar to what I typically see when a plugin is either violating thread-safety rules with async scheduler or something similar. Now with that said, all three of my crash reports that have happened the past 48 hours commonly list PreciousStones in the stack trace and "Recent Tasks" before the actual crash.

The only change I've made to PreciousStones recently is that I made some Stones able to be "rentable." I added the "rentable" flag to a protection stone that I've already had configured for a long time.

In all my crash reports, they all report this:
PreciousStones:net.sacredlabyrinth.Phaed.PreciousStones.vectors.Field$Update@16154,
PreciousStones:net.sacredlabyrinth.Phaed.PreciousStones.vectors.Field$Update@16154,
PreciousStones:net.sacredlabyrinth.Phaed.PreciousStones.vectors.Field$Update@16174,
PreciousStones:net.sacredlabyrinth.Phaed.PreciousStones.vectors.Field$Update@16174

My intuition tells me that something somewhere in your field updating is causing these crashes. I still haven't been able to pinpoint any suspect code that would cause these Field Updates to lock up the server.

Hopefully this information helps. You definitely have a much more intuitive understanding of how your field updating works.

Thank you for your time!

commented

Right now there's a couple existing protection stones that are up for Rent.
For now I set my protection stone's configuration to "rentable: false". I also ran the command "ps disableall rentable"

Will performing these two actions stop your code from running any "rent updates"? If so, and assuming my suspicions regarding the "rent field updating" code are correct, my server should stop crashing now?

commented

This is why you're my favorite plugin author! I'll upload this version right now. If you don't hear back from me, it ended up working great :)

commented

Thanks :) I just committed another build with a modification. Download again pls.

commented

My players have been reporting that they can no longer make their basic protection stones. When they place down their protection stones, it just gets placed. No messages or anything, meaning the field is being created. Would you know if the changes you made affected this?

Here is my config: http://pastebin.com/6RGY2zrs

All I have done is add that "rentable" flag and updated to this dev version. Setting rentable to true or false doesn't affect it.

commented

Can you explain better? I'm a bit confused. You say they "can not" make protections, you say that it just gets placed (blocks just get placed without protection?), but then you say the field "is" created. If the fields are created, that means they can place protections. I don't understand. Or is it that fields get placed without messages, but then why did you say players can't place protections? I'm confused.

commented

Sorry, typo. The field is NOT being created. It's as if the block is being placed normally.

commented

Revert to the build before I made the async updates. Let me know if that fixes it, to confirm that the new build has the problems.

commented

I will have to wait until I get home from work tonight to investigate further. The last version I used before I updated to your async changes was: #202 (Jan 8, 2013 1:26:18 AM)

There were a lot of commits since then.

commented

Awesome. Thanks for finding the build. Ok so you have sneak-to-place on and your players are sneaking but its not placing. Is that correct?

commented

Correct. The block itself gets placed, but no fields are being created.

commented

Okay found where my protection stones broke. I use sneak-to-place, so my players have to be sneaking when they place the field for it to work.

It breaks in between versions:
It works: Build #188 (Jan 5, 2013 3:36:58 PM)
It doesn't work: #189 (Jan 5, 2013 3:56:41 PM)

I tried Build #190 where your commit says "Fix for sneak-to-place-fields (fixes #465)", but that doesn't work either.

commented

While I wait for a fix, will setting "rentable: false" and running "/ps disableall rentable" temporarily stop the crashes caused by rentable fields?

commented

It should.