@@ -582,9 +582,23 @@ impl<'a, 'cfg> DrainState<'a, 'cfg> {
582
582
// listen for a message with a timeout, and on timeout we run the
583
583
// previous parts of the loop again.
584
584
let events: Vec < _ > = self . rx . try_iter ( ) . collect ( ) ;
585
+ info ! (
586
+ "tokens in use: {}, rustc_tokens: {:?}, waiting_rustcs: {:?} (events this tick: {})" ,
587
+ self . tokens. len( ) ,
588
+ self . rustc_tokens
589
+ . iter( )
590
+ . map( |( k, j) | ( k, j. len( ) ) )
591
+ . collect:: <Vec <_>>( ) ,
592
+ self . to_send_clients
593
+ . iter( )
594
+ . map( |( k, j) | ( k, j. len( ) ) )
595
+ . collect:: <Vec <_>>( ) ,
596
+ events. len( ) ,
597
+ ) ;
585
598
if events. is_empty ( ) {
586
599
loop {
587
600
self . tick_progress ( ) ;
601
+ self . tokens . truncate ( self . active . len ( ) - 1 ) ;
588
602
match self . rx . recv_timeout ( Duration :: from_millis ( 500 ) ) {
589
603
Ok ( message) => break vec ! [ message] ,
590
604
Err ( _) => continue ,
@@ -618,13 +632,6 @@ impl<'a, 'cfg> DrainState<'a, 'cfg> {
618
632
loop {
619
633
self . spawn_work_if_possible ( cx, jobserver_helper, scope, error. is_some ( ) ) ?;
620
634
621
- info ! (
622
- "tokens: {}, rustc_tokens: {}, waiting_rustcs: {}" ,
623
- self . tokens. len( ) ,
624
- self . rustc_tokens. len( ) ,
625
- self . to_send_clients. len( )
626
- ) ;
627
-
628
635
// If after all that we're not actually running anything then we're
629
636
// done!
630
637
if self . active . is_empty ( ) {
@@ -638,7 +645,6 @@ impl<'a, 'cfg> DrainState<'a, 'cfg> {
638
645
// jobserver interface is architected we may acquire a token that we
639
646
// don't actually use, and if this happens just relinquish it back
640
647
// to the jobserver itself.
641
- self . tokens . truncate ( self . active . len ( ) - 1 ) ;
642
648
for event in self . wait_for_events ( ) {
643
649
if let Some ( err) = self . handle_event ( cx, jobserver_helper, plan, event) ? {
644
650
error = Some ( err) ;
0 commit comments