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

Fix CME when getting while computing #29

Merged
merged 1 commit into from
Feb 19, 2021
Merged

Fix CME when getting while computing #29

merged 1 commit into from
Feb 19, 2021

Conversation

HSGamer
Copy link
Contributor

@HSGamer HSGamer commented Feb 16, 2021

No description provided.

@tastybento
Copy link
Member

Can you share the error you were getting before the fix?

What triggered the error?

@HSGamer
Copy link
Contributor Author

HSGamer commented Feb 17, 2021

It's a rare case when a placeholder try to get the likes asynchronously.
I missed the stacktrace so I don't have the details.
I remember this line tell the issue
Since it's rarely to happen, I think we can close this pull request until I get the issue.

@HSGamer
Copy link
Contributor Author

HSGamer commented Feb 18, 2021

This is the log that tells the exception

[10:02:53] [Craft Scheduler Thread - 13/WARN]: [SimpleBoard] Plugin SimpleBoard v1.0-SNAPSHOT generated an exception while executing task 614
java.util.ConcurrentModificationException: null
	at java.util.HashMap.computeIfAbsent(HashMap.java:1226) ~[?:?]
	at world.bentobox.likes.managers.LikesManager.load(LikesManager.java:152) ~[?:?]
	at world.bentobox.likes.managers.LikesManager.newPlayer(LikesManager.java:233) ~[?:?]
	at world.bentobox.likes.managers.LikesManager.getIslandLikes(LikesManager.java:220) ~[?:?]
	at world.bentobox.likes.managers.LikesManager.getIslandLikes(LikesManager.java:261) ~[?:?]
	at world.bentobox.likes.placeholders.LikesAddonPlaceholderType.getObject(LikesAddonPlaceholderType.java:1445) ~[?:?]
	at world.bentobox.likes.placeholders.LikesAddonPlaceholderType.lambda$static$0(LikesAddonPlaceholderType.java:33) ~[?:?]
	at world.bentobox.likes.placeholders.LikesAddonPlaceholderType$$Lambda$5528/00000000DDDD7770.onReplace(Unknown Source) ~[?:?]
	at world.bentobox.likes.placeholders.LikesAddonPlaceholder.onReplace(LikesAddonPlaceholder.java:52) ~[?:?]
	at world.bentobox.bentobox.api.placeholders.placeholderapi.BasicPlaceholderExpansion.onPlaceholderRequest(BasicPlaceholderExpansion.java:47) ~[?:?]
	at world.bentobox.bentobox.api.placeholders.placeholderapi.AddonPlaceholderExpansion.onPlaceholderRequest(AddonPlaceholderExpansion.java:5) ~[?:?]
	at me.clip.placeholderapi.PlaceholderHook.onRequest(PlaceholderHook.java:31) ~[?:?]
	at me.clip.placeholderapi.replacer.CharsReplacer.apply(CharsReplacer.java:156) ~[?:?]
	at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:69) ~[?:?]
	at me.hsgamer.simpleboard.Utils.replacePlaceholders(Utils.java:26) ~[?:?]
	at me.hsgamer.simpleboard.Utils.format(Utils.java:16) ~[?:?]
	at me.hsgamer.simpleboard.Board.lambda$update$0(Board.java:24) ~[?:?]
	at me.hsgamer.simpleboard.Board$$Lambda$6273/000000005012E410.apply(Unknown Source) ~[?:?]
	at java.util.ArrayList.replaceAllRange(ArrayList.java:1712) ~[?:?]
	at java.util.ArrayList.replaceAll(ArrayList.java:1702) ~[?:?]
	at me.hsgamer.simpleboard.Board.update(Board.java:24) ~[?:?]
	at me.hsgamer.simpleboard.Board$$Lambda$6155/00000000DDFD0540.run(Unknown Source) ~[?:?]
	at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100) ~[server-patched.jar:git-Paper-469]
	at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) ~[server-patched.jar:git-Paper-469]
	at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[server-patched.jar:git-Paper-469]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]
	at java.lang.Thread.run(Thread.java:851) [?:?]

@BONNe
Copy link
Member

BONNe commented Feb 18, 2021

I am currently thinking of applying merge or fixing placeholder code.
I implemented it in lazy way, so it is less lines of code, and did not check if that is correct.

tasty, what do you think, apply merge or fix an issue in other parts?

@tastybento
Copy link
Member

I don't think there is a obligation for us to support async placeholder requests, but this PR is not a big change - just changing to concurrent hashmap. So, I think it should be fine to merge this PR and then work on other items. I'll let you decide @BONNe.

@BONNe BONNe merged commit f97b232 into BentoBoxWorld:develop Feb 19, 2021
@BONNe
Copy link
Member

BONNe commented Feb 19, 2021

Thanks for your fix @HSGamer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants