This repository was archived by the owner on Feb 6, 2026. It is now read-only.
Commit 21813a7
fix(dal): synchronize graph access in dependent values update
The concurrency types used by the WorkspaceSnapshot to provide interior
mutability in the tokio run time are *not* sufficient to prevent data
races when operating on the same graph on different threads, since our
graph operations are not "atomic" and the graph *WILL* end up being read
from different threads while a write operation is still in progress if
it is shared between threads for modification. For example after a node
is added but *before* the edges necessary to place that node in the
right spot in the graph.
A more general solution is needed to represent the concept of a
"transaction" when mutating the graph, to prevent other readers from
seeing incomplete graphs from in-progress write operations.
For now, we have added a lock to `DependentValuesUpdate` that ensures
the portion of the update that gathers the inputs to a function acquires
a read lock, (which is released as soon as the function is sent to the
executor, so that we don't hold on to it while executing in veritech),
while the portion of the update that updates the graph with the
execution result acquires a write lock.
Co-Authored-By: Jacob Helwig <jacob@systeminit.com>
Co-Authored-By: Nick Gerace <nick@systeminit.com>
Co-Authored-By: Scott Prutton <scott@systeminit.com>1 parent 3fc360f commit 21813a7
3 files changed
Lines changed: 49 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
497 | 497 | | |
498 | 498 | | |
499 | 499 | | |
| 500 | + | |
500 | 501 | | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
501 | 511 | | |
502 | 512 | | |
503 | 513 | | |
| |||
619 | 629 | | |
620 | 630 | | |
621 | 631 | | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
622 | 636 | | |
623 | 637 | | |
624 | 638 | | |
| |||
721 | 735 | | |
722 | 736 | | |
723 | 737 | | |
| 738 | + | |
| 739 | + | |
724 | 740 | | |
725 | | - | |
| 741 | + | |
726 | 742 | | |
727 | 743 | | |
728 | 744 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
| |||
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
| 65 | + | |
| 66 | + | |
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
| |||
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
| 80 | + | |
74 | 81 | | |
75 | 82 | | |
76 | 83 | | |
| |||
149 | 156 | | |
150 | 157 | | |
151 | 158 | | |
| 159 | + | |
152 | 160 | | |
153 | 161 | | |
154 | 162 | | |
| |||
161 | 169 | | |
162 | 170 | | |
163 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
164 | 178 | | |
165 | 179 | | |
166 | 180 | | |
| |||
216 | 230 | | |
217 | 231 | | |
218 | 232 | | |
| 233 | + | |
219 | 234 | | |
220 | | - | |
221 | | - | |
222 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
223 | 239 | | |
224 | 240 | | |
225 | 241 | | |
| |||
234 | 250 | | |
235 | 251 | | |
236 | 252 | | |
| 253 | + | |
237 | 254 | | |
238 | 255 | | |
239 | 256 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
104 | 114 | | |
105 | 115 | | |
106 | 116 | | |
| |||
0 commit comments