View Issue Details

IDProjectCategoryView StatusLast Update
0000554Medieval EngineersBugpublic2026-02-15 16:06
Reporterequinox Assigned Toequinox  
PrioritynormalSeverityminorReproducibilityhave not tried
Status in progressResolutionopen 
Target Version0.7.4.xh (unreleased) 
Summary0000554: Likely race condition in AsynchronousLoader.GetObjectImmediately
Description

AsynchronousLoader.GetObjectImmediately is used from many threads, all at once, when loading XML serializers during definition deserialization (via Storage.TryGetValue, via MyXmlSerializerManager)

The intended threading here is:

  1. tA acquires the tracker lock
  2. tB blocks on the tracker lock
  3. tA reads the current job state, marks it as Working = true
  4. tA releases the tracker lock
  5. tA acquires the job target lock, and starts to load the item
  6. tB with the tracker lock: reads the current job state, notes that it is already working
  7. tB, blocks on the job target lock
  8. tA finishes loading, releases the job target lock
  9. tB with the job target lock, reads the value

The implementation of this has the potential to race where tA, the that that took ownership over loading the item, didn't acquire the work lock prior to tB, the thread that didn't take ownership over loading:

  1. tA acquires the tracker lock
  2. tB blocks on the tracker lock
  3. tA reads the current job state, marks it as Working = true
  4. tA releases the tracker lock
  5. tB with the tracker lock: reads the current job state, notes that it is already working
  6. tB, assuming that tA has already started work, acquires the job target lock
  7. tB, immediately releases the job target lock, and assumes the job is done
  8. tA acquires the job target lock and loads the item
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2026-02-14 02:34 equinox New Issue
2026-02-14 16:37 equinox Target Version => 0.7.4.xh (unreleased)
2026-02-15 16:06 equinox Assigned To => equinox
2026-02-15 16:06 equinox Status new => in progress