#5697 Timeout on solr queries

v1.0.0
closed
General
2015-08-20
2013-01-28
No

Some solr queries can be really slow. We should have a configurable timeout on our solr queries so the original web request stops after several seconds and doesn't jam things up.

Make sure this doesn't negatively impact add/remove artifact tasks that could be huge and take a long time (which is ok). Do we have other solr read queries that don't originate from web requests and should be given long timeouts?

Discussion

  • Dave Brondsema

    Dave Brondsema - 2013-01-28
    • size: --> 1
     
  • Cory Johns - 2013-01-28
    • status: open --> in-progress
    • assigned_to: Cory Johns
     
  • Cory Johns - 2013-01-28

    allura:cj/5697

     
  • Cory Johns - 2013-01-28
    • status: in-progress --> code-review
     
  • Dave Brondsema

    Dave Brondsema - 2013-01-29
    • status: code-review --> in-progress
    • qa: Dave Brondsema
     
  • Dave Brondsema

    Dave Brondsema - 2013-01-29

    One line uses with_timeout which isn't right.

    Overall, it's not pretty, but that's more pysolr's fault than ours. Could search_artifact use the search() method too, so the if stmt doesn't have to be duplicated?

     
  • Cory Johns - 2013-01-29

    It could not, as search() is wrapped with @try_solr.

    As for making it prettier, I could make our subclass redefine search() to accept a timeout instead of requiring it at __init__ by temporarily setting self.timeout before calling super, but I was mildly concerned about potential concurrency issues.

     
  • Cory Johns - 2013-01-29

    Alternatively / additionally, we could make the default value be the common case (short timeout) so that we don't have to manually specify it every time, but I went with default as long to be safer if I missed any cases (scripts).

     
  • Cory Johns - 2013-01-29

    with_timeout fix pushed

     
  • Cory Johns - 2013-01-29
    • status: in-progress --> code-review
     
  • Cory Johns - 2013-01-29

    Consolidation of Solr error handling added.

     
  • Dave Brondsema

    Dave Brondsema - 2013-01-29
     
  • Dave Brondsema

    Dave Brondsema - 2013-01-29
    • status: code-review --> closed
     

Log in to post a comment.