Commit 300c7a1
committed
libsubprocess: avoid using child watchers
Problem: child watchers are only used by libsubprocess, and probably
do not need to be in the public API since libsubprocess is provided
for managing child processes. In addition, we are considering porting
Flux to libuv and libuv does not offer similar functionality.
Register a signal watcher for SIGCHLD within libsubprocess that
persists as long as there are subprocesses to monitor, and calls
waitpid(2) to consume all subprocess state changes. Add a hash by pid
and allow subprocess objects to register a callback to receive these
changes for a given pid.
Have all subprocess users create reactors without FLUX_REACTOR_SIGCHLD,
as the default ev_loop registers a SIGCHLD watcher that conflicts with
this one.
Add EVFLAG_SIGNALFD to the non-default loop, as that flag was used with
reactors created with FLUX_REACTOR_SIGCHLD, and appears to be be required
to avoid sharness tests hanging randomly.1 parent da7a958 commit 300c7a1
File tree
22 files changed
+414
-76
lines changed- src
- broker
- test
- cmd
- builtin
- common
- libflux
- libsubprocess
- test
- libterminus/test
- libtestutil
- shell
22 files changed
+414
-76
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
252 | | - | |
| 251 | + | |
253 | 252 | | |
254 | 253 | | |
255 | 254 | | |
256 | 255 | | |
257 | 256 | | |
258 | 257 | | |
259 | 258 | | |
260 | | - | |
| 259 | + | |
261 | 260 | | |
262 | 261 | | |
263 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
353 | | - | |
354 | 353 | | |
355 | 354 | | |
356 | 355 | | |
| |||
360 | 359 | | |
361 | 360 | | |
362 | 361 | | |
363 | | - | |
364 | | - | |
365 | 362 | | |
366 | 363 | | |
367 | | - | |
368 | | - | |
369 | 364 | | |
370 | 365 | | |
371 | 366 | | |
| |||
374 | 369 | | |
375 | 370 | | |
376 | 371 | | |
377 | | - | |
378 | 372 | | |
379 | 373 | | |
380 | 374 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
| 388 | + | |
| 389 | + | |
392 | 390 | | |
393 | 391 | | |
394 | 392 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1074 | 1074 | | |
1075 | 1075 | | |
1076 | 1076 | | |
1077 | | - | |
| 1077 | + | |
1078 | 1078 | | |
1079 | 1079 | | |
1080 | 1080 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
296 | | - | |
297 | 296 | | |
298 | 297 | | |
299 | 298 | | |
300 | 299 | | |
301 | 300 | | |
302 | 301 | | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | 302 | | |
309 | 303 | | |
310 | 304 | | |
311 | 305 | | |
312 | | - | |
313 | 306 | | |
314 | 307 | | |
315 | 308 | | |
| |||
330 | 323 | | |
331 | 324 | | |
332 | 325 | | |
333 | | - | |
| 326 | + | |
334 | 327 | | |
335 | 328 | | |
336 | 329 | | |
337 | | - | |
338 | 330 | | |
339 | 331 | | |
340 | 332 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| 53 | + | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| |||
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
105 | 113 | | |
106 | 114 | | |
107 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
449 | 450 | | |
450 | 451 | | |
451 | 452 | | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
| 453 | + | |
456 | 454 | | |
457 | 455 | | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | 456 | | |
467 | 457 | | |
468 | 458 | | |
| |||
480 | 470 | | |
481 | 471 | | |
482 | 472 | | |
483 | | - | |
484 | | - | |
485 | | - | |
| 473 | + | |
| 474 | + | |
486 | 475 | | |
487 | 476 | | |
488 | 477 | | |
| |||
502 | 491 | | |
503 | 492 | | |
504 | 493 | | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
| 494 | + | |
| 495 | + | |
512 | 496 | | |
513 | 497 | | |
514 | | - | |
515 | 498 | | |
516 | 499 | | |
517 | 500 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
709 | 711 | | |
710 | 712 | | |
711 | 713 | | |
| 714 | + | |
| 715 | + | |
712 | 716 | | |
713 | 717 | | |
714 | 718 | | |
| |||
750 | 754 | | |
751 | 755 | | |
752 | 756 | | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
753 | 762 | | |
754 | 763 | | |
755 | 764 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
0 commit comments