Skip to content

Commit 8c2407d

Browse files
author
Devdutt Shenoi
committed
don't panic!
1 parent c9ff7a7 commit 8c2407d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/parseable/streams.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,7 @@ impl Stream {
325325
// if yes, then merge them and save
326326

327327
if let Some(mut schema) = schema {
328-
let static_schema_flag = self.get_static_schema_flag();
329-
if !static_schema_flag {
328+
if !self.get_static_schema_flag() {
330329
// schema is dynamic, read from staging and merge if present
331330

332331
// need to add something before .schema to make the file have an extension of type `schema`
@@ -477,7 +476,16 @@ impl Stream {
477476
.set(arrow_files.len() as i64);
478477

479478
for file in &arrow_files {
480-
let file_size = file.metadata().unwrap().len();
479+
let file_size = match file.metadata() {
480+
Ok(meta) => meta.len(),
481+
Err(err) => {
482+
error!(
483+
"Looks like the file ({}) was removed; Error = {err}",
484+
file.display()
485+
);
486+
continue;
487+
}
488+
};
481489

482490
metrics::STORAGE_SIZE
483491
.with_label_values(&["staging", &self.stream_name, ARROW_FILE_EXTENSION])

0 commit comments

Comments
 (0)