From 30ce35d29bc5daa90a3fb08fae1af06663979382 Mon Sep 17 00:00:00 2001 From: Thijs Hekman Date: Wed, 21 Jun 2023 11:00:38 +0200 Subject: [PATCH] Completed all flush statements. Now on Thijs machine, it looks like it does not crash anymore under normal circumstances --- src/lasp/lasp_record.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lasp/lasp_record.py b/src/lasp/lasp_record.py index f3086dc..158665b 100644 --- a/src/lasp/lasp_record.py +++ b/src/lasp/lasp_record.py @@ -85,6 +85,7 @@ class Recording: try: # Open the file self.f = h5py.File(self.fn, "w", 'stdio') + self.f.flush() except Exception as e: logging.error(f'Error creating measurement file {e}') raise @@ -151,6 +152,7 @@ class Recording: # Measured physical quantity metadata # This was how it was in LASP version < 1.0 # f.attrs['qtys'] = [ch.qty.to_json() for ch in in_ch] + f.flush() def firstFrames(self, adata): """ @@ -227,10 +229,12 @@ class Recording: # instantaneously. For which we have to implement extra mutex # guards in this class del self.indh + self.indh = None # Remove handle to dataset otherwise the h5 file is not closed # properly. del self.ad + self.ad = None try: # Close the recording file