EUDAT-B2STAGE / http-api

RESTful HTTP-API for the B2STAGE service inside the EUDAT project
https://eudat-b2stage.github.io/http-api/
MIT License
7 stars 7 forks source link

Rare issue during enable #138

Closed merretbuurman closed 5 years ago

merretbuurman commented 5 years ago

Rare issue during "enable": If creation of the directory on the fs fails (e.g. because NFS share is broken), the batch can never be enabled, as the subsequent requests will always return "Already exists".

"Enabling" does two things:

But only (A) is checked [2]. So if (A) succeeds and (B) fails (e.g. because NFS share is broken), we're screwed.

Suggestion: Also check if directory exists, of catch exceptions on creating the path and then also delete the collection again. The latter may be better, as this happens rarely.

[0] https://github.com/EUDAT-B2STAGE/http-api/blob/1.0.4/projects/b2stage/backend/apis/ingestion.py#L258 [1] https://github.com/EUDAT-B2STAGE/http-api/blob/1.0.4/projects/b2stage/backend/apis/ingestion.py#L264 [2] https://github.com/EUDAT-B2STAGE/http-api/blob/1.0.4/projects/b2stage/backend/apis/ingestion.py#L254

merretbuurman commented 5 years ago

Addressed (partially) by https://github.com/EUDAT-B2STAGE/http-api/pull/139

mdantonio commented 5 years ago

In case of errors the irods collection can be removed with: imain.remove(batch_path, recursive=True, force=True)