chicks / sugarcrm

A ruby based REST Client for SugarCRM
MIT License
90 stars 64 forks source link

Do we need to replace net/http with something better? #22

Closed chicks closed 13 years ago

chicks commented 13 years ago

I've been chasing some random timeout issues with the gem, and I think some of them might be related to issues with ruby 1.8's timeout implementation. The basic gist is here: http://blog.headius.com/2008/02/rubys-threadraise-threadkill-timeoutrb.html

The Excon gem looks promising, since it's what Fog uses and it supports persistant connections.

davidsulc commented 13 years ago

(Link is dead.)

FYI, I've been having timeout issues when working with the API, even when using the SOAP API (i.e. without the gem). I suspect it's due to the server in my case, but figured I'd mention it here.

If I connect to Sugar via the web interface, while the gem is returning TimeoutErrors, it responds and I can work with it.

Also, interestingly, when I'm iterating over records (e.g. retrieving slices of 50 contacts at a time with a retry in the rescue block), the TimeoutError is quite regular (e.g. 4 timeouts, then a successful connection with 50 contacts returned, 4 timeouts again, etc.).

chicks commented 13 years ago

With SOAP are you using ruby net/http?

Try this link: http://userprimary.net/posts/2008/04/13/setting-a-longer-timeout-for-nethttp-requests-in-ruby/

And this one: http://headius.blogspot.com/2008/02/rubys-threadraise-threadkill-timeoutrb.html

davidsulc commented 13 years ago

That is exactly the error I'm getting, although not consistently: when there is an issue that's the error I get, but whether I get the error or not is seemingly random...

When I'm querying record slices, and I start getting the error it tends to stick around on subsequent calls, though.

When I used SOAP, I simply required soap/wsdlDriver (built-in up to v. 1.8.7). Note: it could be I was simply trying to query too many records at once. (Happened a while ago, can't recall the specifics...)