File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
data-loader/core/src/main/java/com/scalar/db/dataloader/core/dataexport Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -105,20 +105,21 @@ public ExportReport startExport(
105105 isFirstBatch ,
106106 exportReport ));
107107 }
108- executorService .shutdown ();
109- if (executorService .awaitTermination (Long .MAX_VALUE , TimeUnit .NANOSECONDS )) {
110- logger .info ("All tasks completed" );
111- } else {
112- logger .error ("Timeout occurred while waiting for tasks to complete" );
113- // TODO: handle this
114- }
115108 processFooter (exportOptions , tableMetadata , bufferedWriter );
116- } catch (InterruptedException
117- | IOException
118- | UnknownTransactionStatusException
119- | CrudException e ) {
109+ } catch (IOException | UnknownTransactionStatusException | CrudException e ) {
120110 logger .error ("Error during export: " , e );
121111 } finally {
112+ executorService .shutdown ();
113+ try {
114+ if (executorService .awaitTermination (Long .MAX_VALUE , TimeUnit .NANOSECONDS )) {
115+ logger .info ("All tasks completed" );
116+ } else {
117+ logger .error ("Timeout occurred while waiting for tasks to complete" );
118+ }
119+ } catch (InterruptedException e ) {
120+ Thread .currentThread ().interrupt ();
121+ logger .error ("Interrupted while waiting for executor termination" , e );
122+ }
122123 bufferedWriter .flush ();
123124 }
124125 } catch (ExportOptionsValidationException | IOException | ScalarDbDaoException e ) {
You can’t perform that action at this time.
0 commit comments