Skip to content

fix async pathfinding tick rate#785

Open
hayanesuru wants to merge 1 commit into
ver/26.2from
pathfinding
Open

fix async pathfinding tick rate#785
hayanesuru wants to merge 1 commit into
ver/26.2from
pathfinding

Conversation

@hayanesuru

Copy link
Copy Markdown
Collaborator

cache paper sensor & behavior tick rate

remove no effect CompletableFuture#orTimeout

replace NearestBedSensor tick rate

@hayanesuru hayanesuru requested a review from Dreeam-qwq June 22, 2026 07:40
@Dreeam-qwq Dreeam-qwq added type: fix Pull request for fixing bug type: general Pull request for general updates / changes, patch regular maintenance labels Jun 26, 2026

@noramibu noramibu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO this looks risky because it can make async pathfinding run on the main server thread again

From what I understand, old logic only used pending path when the async worker had already finished it, but new logic tries to finish the pending path immediately. If the async worker has not finished yet, main thread may end up waiting for it or doing the path calculation itself and under load it may cause TPS/MSPT spikes, especially with villagers searching for beds or job sites

I believe a safer flow would be: if the pending path is ready, use it; if it is not ready yet, keep it pending and try again later ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Pull request for fixing bug type: general Pull request for general updates / changes, patch regular maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants