Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Ctrc-C is not handled properly in bibdocfile #1060

Closed
invenio-developers opened this Issue · 7 comments

3 participants

@invenio-developers
Collaborator

Originally by adeiana (@Osso) on 2012-05-15

You can refer to this ticket if you have access
https://inspirert.cern.ch/Ticket/Display.html?id=203418

When running a script and pressing Ctrl-C it is handled as an error to read from the disk and list of md5sums is reset.

@kaplun
Collaborator

Originally on 2013-02-15

Hi Alessio,

I just checked this, and actually, also from your attachment, as you can see from:

http://invenio-software.org/attachment/ticket/1060/traceback.txt#L150

    -------------------------------------------------------------------------------
147       3248         except IOError:
148       3249             self.update()
149       3250         except Exception, e:
150 ----> 3251             register_exception()
151       3252             raise InvenioWebSubmitFileError, "Encountered an exception while loading .md5 for folder '%s': '%s'" % (self.folder, e)
152       3253
153       3254     def check(self, filename = ''):
154 -------------------------------------------------------------------------------

The exception is caught in general, and only registered. the update() of the MD5 is only called in case of real IOError, not KeyboardInterrupt (a.k.a. Ctrl-C)

@kaplun
Collaborator

Originally on 2013-02-15

Ah nope, I see. Just later there is the .update() call in case of generic InvenioWebSubmitFileError. D'oh.

@kaplun
Collaborator

Originally on 2013-02-15

Improvements in this sense are now implemented in my public branch sam/1060-fix-md5-exception-handling

@tiborsimko
Owner

Originally on 2013-02-22

Thanks, I've fixed one issue (register_exception(alert_admin(True)) and I'll merge shortly.

@kaplun kaplun closed this
@kaplun
Collaborator

Originally on 2013-02-22

In 14b3fde:

#CommitTicketReference repository="invenio" revision="14b3fde07dadbb69194df52ab4b8ab0dbd513cdf"
BibDocFile: handling of exceptions in Md5Folder

- Improves handling of exceptions in Md5Folder by not causing automatic
  reload of md5 in case of Exceptions. (closes #1060)

- Additionally, always use register_exception(alert_admin=True) in case
  of MD5 related issues, as these are severe enough to call for further
  human check.

- Introduces Md5Folder regression tests.

Reported-by: Alessio Deiana <alessio.deiana@cern.ch>
Reviewed-by: Tibor Simko <tibor.simko@cern.ch>
@kaplun
Collaborator

Originally on 2013-02-22

In 14b3fde:

#CommitTicketReference repository="invenio" revision="14b3fde07dadbb69194df52ab4b8ab0dbd513cdf"
BibDocFile: handling of exceptions in Md5Folder

- Improves handling of exceptions in Md5Folder by not causing automatic
  reload of md5 in case of Exceptions. (closes #1060)

- Additionally, always use register_exception(alert_admin=True) in case
  of MD5 related issues, as these are severe enough to call for further
  human check.

- Introduces Md5Folder regression tests.

Reported-by: Alessio Deiana <alessio.deiana@cern.ch>
Reviewed-by: Tibor Simko <tibor.simko@cern.ch>
@kaplun
Collaborator

Originally on 2013-02-22

In 14b3fde:

#CommitTicketReference repository="invenio" revision="14b3fde07dadbb69194df52ab4b8ab0dbd513cdf"
BibDocFile: handling of exceptions in Md5Folder

- Improves handling of exceptions in Md5Folder by not causing automatic
  reload of md5 in case of Exceptions. (closes #1060)

- Additionally, always use register_exception(alert_admin=True) in case
  of MD5 related issues, as these are severe enough to call for further
  human check.

- Introduces Md5Folder regression tests.

Reported-by: Alessio Deiana <alessio.deiana@cern.ch>
Reviewed-by: Tibor Simko <tibor.simko@cern.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.