metrumresearchgroup / bbi

Next generation modeling platform
11 stars 2 forks source link

write `bbi_config.json` even on failure? #318

Open kyleam opened 2 months ago

kyleam commented 2 months ago

[ related to metrumresearchgroup/bbr#685, +cc @seth127 @barrettk ]

For the various errors where RecordConcurrentError is invoked (including a non-zero exit of the nmfe* subprocess)

https://github.com/metrumresearchgroup/bbi/blob/835953efed10fff2d7024ac1c3dd88949b268c05/cmd/local.go#L185-L191

... true is sent the cancel channel

https://github.com/metrumresearchgroup/bbi/blob/835953efed10fff2d7024ac1c3dd88949b268c05/cmd/root.go#L177-L178

... which stops the execution before the turnstile cleanup phase.

As a result, bbi_config.json isn't written. As discussed at metrumresearchgroup/bbr#685, from bbr's perspective it would be useful to have bbi_config.json consistently written as an indication that a model run has completed (even if unsuccessfully).

When considering this change, we should go through local's Cleanup and decide which parts should run in case of a failure.


Here are three related issues mentioned in the bbr thread. (At this point I'll track them here, but if they don't end up getting handled by the same series, they should be split off into dedicated issues.)