|
1 | 1 | // Copyright 2023 Oxide Computer Company |
2 | 2 | use crate::{ |
3 | | - cdt, integrity_hash, io_limits::ClientIOLimits, live_repair::ExtentInfo, |
4 | | - upstairs::UpstairsConfig, upstairs::UpstairsState, ClientIOStateCount, |
5 | | - ClientId, ConnectionMode, CrucibleDecoder, CrucibleError, DownstairsIO, |
6 | | - DsState, DsStateData, EncryptionContext, IOState, IOop, JobId, Message, |
7 | | - RawReadResponse, ReconcileIO, ReconcileIOState, RegionDefinitionStatus, |
8 | | - RegionMetadata, |
| 3 | + cdt, format_job_list, integrity_hash, io_limits::ClientIOLimits, |
| 4 | + live_repair::ExtentInfo, upstairs::UpstairsConfig, upstairs::UpstairsState, |
| 5 | + ClientIOStateCount, ClientId, ConnectionMode, CrucibleDecoder, |
| 6 | + CrucibleError, DownstairsIO, DsState, DsStateData, EncryptionContext, |
| 7 | + IOState, IOop, JobId, Message, RawReadResponse, ReconcileIO, |
| 8 | + ReconcileIOState, RegionDefinitionStatus, RegionMetadata, |
9 | 9 | }; |
10 | 10 | use crucible_common::{x509::TLSContext, NegotiationError, VerboseTimeout}; |
11 | 11 | use crucible_protocol::{ |
@@ -399,7 +399,8 @@ impl DownstairsClient { |
399 | 399 | }); |
400 | 400 | info!( |
401 | 401 | self.log, |
402 | | - " {} final dependency list {:?}", ds_id, dependencies |
| 402 | + " {ds_id} final dependency list {}", |
| 403 | + format_job_list(dependencies), |
403 | 404 | ); |
404 | 405 | } |
405 | 406 | } |
@@ -2277,8 +2278,22 @@ impl ClientIoTask { |
2277 | 2278 | "client task could not reply to main task; shutting down?" |
2278 | 2279 | ); |
2279 | 2280 | } |
2280 | | - while let Some(v) = self.request_rx.recv().await { |
2281 | | - warn!(self.log, "exiting client task is ignoring message {v}"); |
| 2281 | + if let Some(v) = self.request_rx.recv().await { |
| 2282 | + // Flush out the queue, waiting for the other side to close the |
| 2283 | + // channel before dropping it ourself. |
| 2284 | + let mut n = 0; |
| 2285 | + while self.request_rx.recv().await.is_some() { |
| 2286 | + n += 1; |
| 2287 | + } |
| 2288 | + warn!( |
| 2289 | + self.log, |
| 2290 | + "exiting client task is ignoring message {v}{}", |
| 2291 | + if n > 0 { |
| 2292 | + format!(" and {n} other messages") |
| 2293 | + } else { |
| 2294 | + "".to_owned() |
| 2295 | + } |
| 2296 | + ); |
2282 | 2297 | } |
2283 | 2298 | info!(self.log, "client task is exiting"); |
2284 | 2299 | } |
|
0 commit comments