Comments (5)
According to the stack trace, could it be waiting for the response from the
remote server? Did you setup any timeout? If yes, it could probably be a
bug in rest-core somewhere... otherwise, try to setup some timeout?
from rest-core.
I didn't have a timeout... so like this: use RC::Timeout, 30
?
from rest-core.
Sorry for the late response. Yes, that would effectively make all the requests
default to 30 seconds timeout. However, I just checked the HTTP client used
underneath rest-core, there should have some default timeout:
https://github.com/nahi/httpclient/blob/v2.5.3.3/lib/httpclient/session.rb#L133-L139
According to your stack trace, it should be receiving some data, therefore it should
have maximum 60 seconds for connecting and 60 seconds for receiving, if you're
posting some data, maybe add another 120 seconds, that means it should
never block more than 240 seconds.
The other possibility to block indefinitely might be, if you're using thread pool by
setting something like this: YourClient.pool_size = 10
, then you can't nest
callbacks more than 10 levels.
For example, suppose the pool size was 1, then this would deadlock:
require 'rest-core'
RC::Universal.pool_size = 1
client = RC::Universal.new
client.get('http://example.com/1') do |_|
puts client.get('http://example.com/2')
end
client.wait # DEADLOCK
This is because a request is only considered done when the callback is
also called, but above we tried to make a second request in the first callback,
waiting for the first callback to be done, but it's never going to be. Therefore
the second request can never begin, and the first callback could never be done.
We could try to detect this deadlock and raise some errors, but I haven't tried to
do so at the moment.
If you're not using callbacks nor thread pool, then nothing should really deadlock.
If you have any ideas what might go wrong, it would be much appreciated.
from rest-core.
Thank you very much! I will observe further and also leave my timeout in...
will come back if I have more info that could be helpful...
from rest-core.
Thank you for trying and reporting :)
Personally I never see this kind of issues, but honestly
I am not too confident if everything is alright.
So please do let me know if there's anything I could help.
Thanks!
from rest-core.
Related Issues (18)
- incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string) HOT 2
- Setting SSL options HOT 5
- RestCore::JsonResponse::ParseError on non-success http status code HOT 5
- Listen for "child_added" HOT 4
- support for oj gem HOT 2
- access response content as Tempfile IO object HOT 6
- add dalli extension for hash compatibility HOT 1
- rest-core [3.0.0] and Ruby 2.4.0. Not able to build client HOT 5
- RestBuilder::Promise: ERROR: incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string) HOT 11
- A payload within a DELETE request is ignored resulting "Invalid request data" from web services. HOT 4
- EventSource vs WebSocket? HOT 5
- "\xAD" from ASCII-8BIT to UTF-8 ERROR when requested GET HOT 7
- Unwanted payload for DELETE request from JsonRequest HOT 1
- Connection refused does not emit exception, future just returns nil instead HOT 4
- FTP client support HOT 3
- JsonResponse error on redirect HOT 2
- Future and nil values HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rest-core.