Skip to content

Skip empty source frames during sliced handover release - #185

Open
viktor-ferenczi wants to merge 1 commit into
mainfrom
codex/se-1908-occupied-handover
Open

viktor-ferenczi wants to merge 1 commit into
mainfrom
codex/se-1908-occupied-handover

Conversation

@viktor-ferenczi

@viktor-ferenczi viktor-ferenczi commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

When an administrator enables release.closePerFrame, the source node used to schedule a close slice for every captured hierarchy ID. Closing a grid already removes its attached blocks. On a large grid, those IDs could keep the source scheduling empty game-thread calls long after the grid was gone.

The source now closes the partition members first, finds surviving children on the game thread, and closes those under the same limit. This preserves cleanup of detached pilots. The new release_descendants phase records the number of captured IDs, the number of survivors, and the time spent finding them.

Verification

The P3-HND-RELEASE-SLICES scenario transferred a 46-block grid with 10 fat blocks between two dedicated servers at release.closePerFrame=1.

Cluster 0.3.34 This change
Source close frames 16 1
Close frames that closed zero entities 15 0
Blocks on the destination 46 46

The candidate scanned 15 captured descendant IDs in 0.8 ms and found zero survivors. The default release.closePerFrame=0 runs the original single-frame release.

Four occupied transfers of an archived base ran in the order 0, 4, 4, 0, with one staging worker and presync disabled. Between 99 and 101 of the original 130 entities remained in the active partition. At a cap of four, the two descendant scans checked 14,383 and 14,132 IDs in 6.4 and 0.5 ms. Neither scan found a surviving world entity. Both players remained connected.

Source measurement Default, first / last Cap of four, middle two
Longest release callback 666 / 653 ms 99 / 234 ms
Longest simulation update interval during release 683 / 669 ms 506 / 252 ms
P99 simulation update interval across the transfer 25 / 26 ms 44 / 131 ms

The cap reduced the longest source update and spread the cost over more updates. A separate stale-ownership purge interrupted both capped releases. In the 506 ms frame it closed the remaining grids outside the release callback. The warm default released the source 679 ms after target traffic was ready, compared with 1,199 and 1,020 ms under the cap. The destination bystander's warm P99 was 32 ms at the default and 41.5 ms in both capped runs. Client impact and target import are tracked in SE-1908.

@viktor-ferenczi
viktor-ferenczi marked this pull request as ready for review November 25, 2026 04:35
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.

1 participant