Repository navigation
Commit 7f23210
fix(skills/bounding-heavy-commands): stop smaller commands from starving a command that needs many slots (#61)
* fix(skills/bounding-heavy-commands): stop smaller commands from overtaking a waiting command
The wrapper kept no order among waiting commands. A command that needs many slots started only when all of them were free at the same moment, so a steady stream of smaller commands could keep it waiting for as long as the stream went on. A first measurement, which needs every slot, was the worst case, while the skill told agents that the queue puts commands in sequence.
Waiters now take a blocking flock on an empty line.lock before they try for slots, and keep it until they hold their slots. Only the waiter at the head of the line tries; the others block in the kernel, which also releases the line lock of a waiter that dies. A waiter behind others logs that it waits behind other commands in the line.
Two cases would stop the whole line, so the head does not keep it there. A waiter checks its exclusive names before it enters the line and leaves the line when a name is taken, so a server that holds a name does not block the commands of other names. The head also leaves the line when no slot comes free for 300 seconds, so a server that holds a slot cannot block its own client behind a command that needs that slot. reserve.lock and the all-or-nothing try stay, so an older copy of the wrapper still shares the slots safely.
Closes #54
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(skills/bounding-heavy-commands): count the memory lock in the test of inherited locks
The layer below added a lock file for the memory check, so the lock directory now holds six files in this test: two slots, the name, the reserve turn, the line, and the memory check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(skills/bounding-heavy-commands): say what the line guarantees and what it does not
The skill said that a large command is never overtaken by smaller commands that arrive after it, and that the commands after a first measurement wait behind it. The kernel gives the line lock to its waiters in no fixed order, and a head with no free slot for 5 minutes lets the others try first. What holds is narrower: only the head tries for slots, so the commands behind it do not take the slots that it waits for.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent e897794 commit 7f23210
3 files changed
Lines changed: 226 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
414 | 415 | | |
415 | 416 | | |
416 | 417 | | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
417 | 441 | | |
418 | 442 | | |
419 | 443 | | |
| 444 | + | |
| 445 | + | |
420 | 446 | | |
421 | | - | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
422 | 465 | | |
423 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
424 | 495 | | |
425 | 496 | | |
426 | 497 | | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
| 498 | + | |
| 499 | + | |
431 | 500 | | |
432 | 501 | | |
433 | 502 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
516 | 516 | | |
517 | 517 | | |
518 | 518 | | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
519 | 594 | | |
520 | 595 | | |
521 | 596 | | |
| |||
1925 | 2000 | | |
1926 | 2001 | | |
1927 | 2002 | | |
1928 | | - | |
| 2003 | + | |
1929 | 2004 | | |
1930 | 2005 | | |
1931 | 2006 | | |
1932 | 2007 | | |
1933 | 2008 | | |
| 2009 | + | |
1934 | 2010 | | |
1935 | | - | |
1936 | | - | |
1937 | | - | |
| 2011 | + | |
1938 | 2012 | | |
1939 | 2013 | | |
| 2014 | + | |
1940 | 2015 | | |
1941 | 2016 | | |
1942 | 2017 | | |
| 2018 | + | |
1943 | 2019 | | |
1944 | 2020 | | |
1945 | 2021 | | |
| |||
1980 | 2056 | | |
1981 | 2057 | | |
1982 | 2058 | | |
1983 | | - | |
| 2059 | + | |
1984 | 2060 | | |
1985 | 2061 | | |
1986 | 2062 | | |
| |||
2163 | 2239 | | |
2164 | 2240 | | |
2165 | 2241 | | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
2166 | 2310 | | |
2167 | 2311 | | |
2168 | 2312 | | |
| |||
0 commit comments