clinet.invoke hangs after a few calls
I am integrating to Xero, and have the following workflow for committing invoices from our billing system:
- look up Contact
- if Contact does not exist, then create one
- build an Invoice (using the Contact) and POST the Invoice
I have a Tomcat Java application that is doing this, one at a time.
The first call always creates the Contact and POSTs the Invoice.
The second call will create the Contact but hangs at POSTing the Invoice
All subsequent calls hang at the "look up Contact" stage...
Restarting Tomcat "resets" everything, and the same process happens again.
Any suggestions? I will be implementing a bulk upload of invoices, rather than one at a time, but this is mysterious...
Any suggestions?
Hi @adampwells did you ever solve this? I'm getting the same problem :( But I get hangs with any call, including GET's after a couple... I think it's something to do with the apache http connection pool and no timeouts set..
Hi @shanness, we ended up doing the batch thing, and the problem went away. We have run into rate limit issues with Xero, and inserted a 2s sleep to make sure we don't go at it too hard. The hanging could be the internal transaction handling not keeping up with the inbound API calls... not sure. Good luck!
Hi there @adampwells . I've found a solution to the permanent hangs. there was a timeout of zero (infinite) in the calls. See line 133 of this commit. https://github.com/shanness/xero-public-and-private/commit/5ad70d95eeade87b825f242951cffd892c5f4b99#diff-024ae9f60023baa15caec0686a5b8c03L133 It doesn't stop all the hangs, just stops later calls from hanging forever as well. I'm currently re-working the library to use scribe instead of googles oauth library, I'm hoping that will clear this up for good.