juhp / pkgtreediff

Tool for comparing rpm package trees
https://hackage.haskell.org/package/pkgtreediff
GNU General Public License v3.0
5 stars 2 forks source link

Option to set timeout #1

Closed jimbair closed 4 years ago

jimbair commented 5 years ago

While running this on the OSCI side of the house, one of our VMs is taking longer to respond on occasion. I am trying to troubleshoot on my side, but it would be helpful if maybe we could allow this to run for longer than 30 seconds?

pkgtreediff: HttpExceptionRequest Request {
  host                 = "foo.bar.com"
   port                 = 80
   secure               = False
   requestHeaders       = []
   path                 = "/comp/rhel-8.1.0-periodic/4936/AppStream/source/tree/Packages/"
   queryString          = ""
   method               = "GET"
   proxy                = Nothing
   rawBody              = False
   redirectCount        = 10
   responseTimeout      = ResponseTimeoutDefault
   requestVersion       = HTTP/1.1
 }
  ResponseTimeout 
 real 0m31.199s
 user 0m0.576s
 sys 0m0.205s

I'm doing what I can on my side to reproduce the issue to find the root cause of the hiccup; ironically, second runs diff without any issues. :) I assume it's the server caching something (or getting NFS to wake up).

Any help/insight is appreciated!

juhp commented 4 years ago

Oops I completely missed this, sorry. Already 5 months passed. :-( Okay I take a look - I just use the defaults, so I am not sure how much can be done to mitigate this on the client side.

If you try to run curl say on that dir what happens or how long does it take? Is it on some slow net storage or something?

jimbair commented 4 years ago

To troubleshoot, I ran wget/cURL with various timeouts to confirm - it is in fact a slow HTTP response causing the issue (I believe I set the timeout in wget to 30 to replicate). Once I re-ran the wget after the 30s timeout, usually the next one worked. I'm not sure what was slowing down the web server, but my guess was back-end storage.

The current work-around is to run the test twice, but an adjustable timeout would solve the problem for us. =)

juhp commented 4 years ago

Okay, I try to see if I can add an option for that, thanks

juhp commented 4 years ago

Okay so the http-client library defaults to 30s timeout - okay it should be easy to add an option to change that.

juhp commented 4 years ago

Okay I have added --timeout for version 0.4, which I plan to release soon.

juhp commented 4 years ago

I have released 0.4 and updated my copr repo.

juhp commented 4 years ago

I think this can be closed now, but do let me know how it works for you.