Skip to content

fix: FoliaAsyncScheduler#schedule(Runnable, Duration) recursing into StackOverflowError - #205

Open
DragonL0508 wants to merge 1 commit into
FairyProject:v0.7from
DragonL0508:fix/folia-async-schedule-recursion
Open

DragonL0508 wants to merge 1 commit into
FairyProject:v0.7from
DragonL0508:fix/folia-async-schedule-recursion

Conversation

@DragonL0508

Copy link
Copy Markdown

FoliaAsyncScheduler overrides schedule(Runnable, long) to call schedule(Runnable, Duration), but never overrides the latter. It falls back to the MCTickBasedScheduler default inherited through FoliaAbstractScheduler, which converts back to ticks and calls schedule(Runnable, long) again, so any delayed Runnable on the Folia async scheduler ends in a StackOverflowError. (The region/global/entity schedulers don't override the tick overload, so they are not affected; Paper doesn't use this class.)

schedule(Runnable, Duration) now goes through the Callable overload, which already talks to the Folia AsyncScheduler directly.

Tests: FoliaAsyncSchedulerTest checks that both Runnable overloads end up in schedule(Callable, Duration) with the right delay.

🤖 Generated with Claude Code

…StackOverflowError

FoliaAsyncScheduler overrides schedule(Runnable, long) to delegate to
schedule(Runnable, Duration), but never overrides the latter. It falls
back to the MCTickBasedScheduler default inherited through
FoliaAbstractScheduler, which converts back to ticks and calls
schedule(Runnable, long) again, so any delayed Runnable on the Folia
async scheduler ends in a StackOverflowError.

Route schedule(Runnable, Duration) to the Callable overload, which
already talks to the Folia AsyncScheduler directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant