materialsproject / maggma

MongoDB aggregation machine
https://materialsproject.github.io/maggma/
Other
38 stars 32 forks source link

Handle store error during finalize #958

Closed jmmshn closed 5 months ago

jmmshn commented 5 months ago

Handle store Error during finalize

I assume the try/except in finalize is meant to handle situations where the store is already closed. https://github.com/materialsproject/maggma/blob/f88951d09b22795fc4e69dc29a6e552b0ab4f676/src/maggma/core/builder.py#L109-L118

However, closing a store: https://github.com/materialsproject/maggma/blob/f88951d09b22795fc4e69dc29a6e552b0ab4f676/src/maggma/stores/mongolike.py#L421-L426

can cause a StoreError if it's already closed. https://github.com/materialsproject/maggma/blob/f88951d09b22795fc4e69dc29a6e552b0ab4f676/src/maggma/stores/mongolike.py#L254-L258

codecov[bot] commented 5 months ago

Codecov Report

Attention: Patch coverage is 50.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 81.31%. Comparing base (f88951d) to head (819d187).

Files Patch % Lines
src/maggma/core/builder.py 50.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #958 +/- ## ======================================= Coverage 81.31% 81.31% ======================================= Files 46 46 Lines 3976 3976 ======================================= Hits 3233 3233 Misses 743 743 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

rkingsbury commented 5 months ago

Thanks @jmmshn !