File tree 2 files changed +20
-2
lines changed 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,18 @@ impl DataChunkBuilder {
229
229
}
230
230
}
231
231
232
+ impl Drop for DataChunkBuilder {
233
+ fn drop ( & mut self ) {
234
+ // Possible to fail when async task gets cancelled.
235
+ if self . buffered_count != 0 {
236
+ tracing:: warn!(
237
+ remaining = self . buffered_count,
238
+ "dropping non-empty data chunk builder"
239
+ ) ;
240
+ }
241
+ }
242
+ }
243
+
232
244
/// The iterator that yields data chunks during appending a data chunk to a [`DataChunkBuilder`].
233
245
pub struct AppendDataChunk < ' a > {
234
246
builder : & ' a mut DataChunkBuilder ,
@@ -249,6 +261,7 @@ impl FusedIterator for AppendDataChunk<'_> {}
249
261
250
262
impl Drop for AppendDataChunk < ' _ > {
251
263
fn drop ( & mut self ) {
264
+ // Possible to fail when async task gets cancelled.
252
265
if self . remaining . is_some ( ) {
253
266
tracing:: warn!( "dropping `AppendDataChunk` without exhausting it" ) ;
254
267
}
Original file line number Diff line number Diff line change @@ -45,8 +45,13 @@ pub struct StreamChunkBuilder {
45
45
46
46
impl Drop for StreamChunkBuilder {
47
47
fn drop ( & mut self ) {
48
- // Possible to fail in some corner cases but should not in unit tests
49
- debug_assert_eq ! ( self . size, 0 , "dropping non-empty stream chunk builder" ) ;
48
+ // Possible to fail when async task gets cancelled.
49
+ if self . size != 0 {
50
+ tracing:: warn!(
51
+ remaining = self . size,
52
+ "dropping non-empty stream chunk builder"
53
+ ) ;
54
+ }
50
55
}
51
56
}
52
57
You can’t perform that action at this time.
0 commit comments