sul-dlss-deprecated / triannon

Rails engine for working with storage of OpenAnnotations stored in Fedora4
Other
13 stars 1 forks source link

triannon/graph.rb:38 doesn't handle an EOFError? #143

Closed dazza-codes closed 9 years ago

dazza-codes commented 9 years ago

trace:

EOFError (end of file reached):
  /home/dlweber/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/protocol.rb:153:in `read_nonblock'
  /home/dlweber/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/protocol.rb:153:in `rbuf_fill'
  /home/dlweber/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/protocol.rb:134:in `readuntil'
  /home/dlweber/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/protocol.rb:144:in `readline'
  /home/dlweber/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/http/response.rb:39:in `read_status_line'
  /home/dlweber/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/http/response.rb:28:in `read_new'
  /home/dlweber/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/http.rb:1413:in `block in transport_request'
  /home/dlweber/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/http.rb:1410:in `catch'
  /home/dlweber/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/http.rb:1410:in `transport_request'
  /home/dlweber/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/http.rb:1383:in `request'
  rdf (1.1.10) lib/rdf/util/file.rb:114:in `block in open_file'
  /home/dlweber/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/http.rb:853:in `start'
  /home/dlweber/.rbenv/versions/2.2.0/lib/ruby/2.2.0/net/http.rb:583:in `start'
  rdf (1.1.10) lib/rdf/util/file.rb:107:in `open_file'
  json-ld (1.1.8) lib/json/ld/writer.rb:180:in `write_epilogue'
  rdf (1.1.10) lib/rdf/writer.rb:223:in `initialize'
  json-ld (1.1.8) lib/json/ld/writer.rb:104:in `initialize'
  rdf (1.1.10) lib/rdf/writer.rb:153:in `new'
  rdf (1.1.10) lib/rdf/writer.rb:153:in `block in buffer'
  rdf (1.1.10) lib/rdf/writer.rb:151:in `open'
  rdf (1.1.10) lib/rdf/writer.rb:151:in `buffer'
  rdf (1.1.10) lib/rdf/writer.rb:130:in `dump'
  rdf (1.1.10) lib/rdf/mixin/enumerable.rb:679:in `dump'
  /data/src/dlss/ld4l_data/annotations/triannon/lib/triannon/graph.rb:38:in `jsonld_oa'
  /data/src/dlss/ld4l_data/annotations/triannon/lib/triannon/graph.rb:89:in `solr_hash'
  /data/src/dlss/ld4l_data/annotations/triannon/app/models/triannon/annotation.rb:105:in `solr_save'
azaroth42 commented 9 years ago

Looks ugly :( Is there a repeatable way to generate the bug, or is it a (network)? robustness issue?

ndushay commented 9 years ago

@darrenleeweber do you have the data that generated this, or some other way to repeat it? o.w. I think it should be closed with "cannot replicate" ...

dazza-codes commented 9 years ago

This is just a case for network exception handling with a rescue/retry block, e.g. https://github.com/sul-dlss/rdf-resource/blob/master/lib/rdf-resource/resource.rb#L59-L79

ndushay commented 9 years ago

the stack trace implies the error occurred when trying to get a Hash from the anno, preparatory to writing to Solr: https://github.com/sul-dlss/triannon/blob/master/app/models/triannon/annotation.rb#L104-107

I am closing this. If it comes up again, we can re-open it, and hopefully we will have the data that caused it and/or more info from the logs.