Commit 44cc1af
committed
bug(backend): Pipeline Version Link Returns "Cannot retrieve pipeline version" Error
Fix race condition in upload_pipeline() that caused "Cannot retrieve
pipeline version" errors when creating new pipelines.
The previous code created a pipeline (which auto-creates a default version),
then created a second version with a random name, then tried to delete the
default version by sorting versions by created_at timestamp. If both versions
had the same timestamp (common with second-precision timestamps), the sort
order was undefined and could delete the wrong version - the one we wanted
to keep. The returned version ID then pointed to a deleted version.
Simplified the flow to just use the default version that upload_pipeline()
creates, eliminating the race condition entirely:
- New pipelines: use the default version created by upload_pipeline()
- Existing pipelines: upload a new version with random name (unchanged)
Signed-off-by: Eder Ignatowicz <ignatowicz@gmail.com>1 parent 0b32cb4 commit 44cc1af
1 file changed
+10
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
131 | 130 | | |
132 | | - | |
133 | | - | |
134 | | - | |
| 131 | + | |
135 | 132 | | |
136 | 133 | | |
137 | 134 | | |
138 | 135 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
| 136 | + | |
| 137 | + | |
146 | 138 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 139 | + | |
153 | 140 | | |
| 141 | + | |
| 142 | + | |
154 | 143 | | |
155 | 144 | | |
156 | 145 | | |
157 | 146 | | |
158 | 147 | | |
159 | | - | |
160 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
161 | 152 | | |
162 | 153 | | |
163 | 154 | | |
| |||
0 commit comments