Commit e08498e
authored
[fix](pipeline) Fix wake up early without terminate call (#63539)
### What problem does this PR solve?
Issue Number: None
Related PR: #61679
Problem Summary: Backport #61679 to branch-4.0. A pipeline task can race
with downstream early wake-up: one thread may observe `_wake_up_early`
as false, then another thread sets `_wake_up_early` and unblocks finish
dependencies, and the first thread later sees `_is_pending_finish()` as
false and finishes without calling operator `terminate()`. For hash join
build tasks this can leave runtime filter producers in
`WAITING_FOR_SYNCED_SIZE`; during close/build, `insert()` expects
`WAITING_FOR_DATA` and reports an invalid runtime filter producer state.
This change moves operator termination after the pending-finish check so
the second `_wake_up_early` read observes the early wake-up and
terminates operators before close.
### Release note
None
### Check List (For Author)
- Test: Unit Test
- `build-support/check-format.sh be/src/pipeline/pipeline_task.cpp
be/test/pipeline/pipeline_task_test.cpp`
- `ninja -C be/build_Release
src/exec/CMakeFiles/Exec.dir/pipeline/pipeline_task.cpp.o`
- `ninja -C be/ut_build_ASAN
src/exec/CMakeFiles/Exec.dir/pipeline/pipeline_task.cpp.o
test/CMakeFiles/doris_be_test.dir/exec/pipeline/pipeline_task_test.cpp.o
test/doris_be_test`
- `be/ut_build_ASAN/test/doris_be_test
--gtest_filter=PipelineTaskTest.TEST_TERMINATE_RACE_FIX
--gtest_print_time=true`
- Behavior changed: No
- Does this need documentation: No1 parent 6151829 commit e08498e
2 files changed
Lines changed: 108 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | 412 | | |
416 | 413 | | |
417 | 414 | | |
418 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
419 | 423 | | |
420 | 424 | | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
421 | 447 | | |
422 | 448 | | |
423 | 449 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
1186 | 1188 | | |
1187 | 1189 | | |
1188 | 1190 | | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
1189 | 1268 | | |
0 commit comments