Skip to content

chore: improve sign layout ticking#1668

Merged
derklaro merged 3 commits intonightlyfrom
improve-sign-layout-ticking
Jun 24, 2025
Merged

chore: improve sign layout ticking#1668
derklaro merged 3 commits intonightlyfrom
improve-sign-layout-ticking

Conversation

@derklaro
Copy link
Member

Motivation

The current sign layout ticking process is based on the assumption that there won't be any race conditions. However, there is a slim chance that a race happens which will then cause all layouts of a holder to freeze until a server restart or config reload.

Modification

Base the sign ticking process and layout retrieval entirely on the last tick when the sign was updated. This removes the need for different places to lock/unlock sign layout ticking and therefore prevents races between the sign ticking thread and the main server thread. This also applies to the map that tracks the layouts that need to be updated as a result of the current tick.

Result

Sign layout ticking is resistent against race conditions and uses the server tick count as the single point of truth when retrieving the applicable sign layout.

@derklaro derklaro added this to the 4.0.0-RC13 milestone Jun 24, 2025
@derklaro derklaro requested a review from 0utplay June 24, 2025 06:48
@derklaro derklaro self-assigned this Jun 24, 2025
@derklaro derklaro added v: 4.X This pull should be included in the 4.0 release t: improvement The pull request improves existing code in: module An issue/pull request releated to one of the internal modules labels Jun 24, 2025
@github-actions
Copy link

Test Results

 56 files  ±0   56 suites  ±0   2m 14s ⏱️ - 1m 1s
566 tests ±0  566 ✅ ±0  0 💤 ±0  0 ❌ ±0 
931 runs  ±0  931 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit c030f29. ± Comparison against base commit 1f00abb.

This pull request removes 31 and adds 31 tests. Note that renamed tests count towards both.
eu.cloudnetservice.driver.impl.document.DocumentSerialisationTest ‑ [4] {"b":1,"s":2,"i":3,"l":4,"f":5.0,"d":6.0,"c":"/","string":"Hello, World!","bol":true,"cloud":["Ben?","Yes","No","HoHoHoHo"],"world":{"this":"is","hello":"world","insane":"!"}}, PRETTY
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [14] 2025-06-22
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [23] 20:57:21.571264662
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [28] 20:57:21.571371482Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [29] 20:57:21.571394445Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [30] 20:57:21.571424762+05:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [31] 20:57:21.571441032-03:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [34] 2025-06-22T20:57:21.571566718
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [39] 2025-06-22T20:57:21.571704125Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [4] 2025-06-22T20:57:21.563581858Z
…
eu.cloudnetservice.driver.impl.document.DocumentSerialisationTest ‑ [4] {"b":1,"s":2,"i":3,"l":4,"f":5.0,"d":6.0,"c":"/","string":"Hello, World!","bol":true,"cloud":["Ben?","Yes","No","HoHoHoHo"],"world":{"this":"is","insane":"!","hello":"world"}}, PRETTY
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [14] 2025-06-24
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [23] 06:49:42.013572335
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [28] 06:49:42.013676020Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [29] 06:49:42.013696658Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [30] 06:49:42.013716846+05:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [31] 06:49:42.013732085-03:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [34] 2025-06-24T06:49:42.016659653
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [39] 2025-06-24T06:49:42.016809956Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [4] 2025-06-24T06:49:42.010216432Z
…

@derklaro derklaro merged commit 780c503 into nightly Jun 24, 2025
6 checks passed
@derklaro derklaro deleted the improve-sign-layout-ticking branch June 24, 2025 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: module An issue/pull request releated to one of the internal modules t: improvement The pull request improves existing code v: 4.X This pull should be included in the 4.0 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants