inertia186 / radiator

Hive Ruby API Client
https://hive.blog/hive-139531/@inertia/radiator-v0-4-8-hive-ruby-api-client-eclipse-update
Other
50 stars 22 forks source link

endless loop #12

Closed Nerossoul closed 6 years ago

Nerossoul commented 6 years ago

on sign transaction some times it gives this error


W, [2017-11-26T07:27:58.703001 #14419] WARN -- : Failover reset, going back to https://api.golos.cf ... E, [2017-11-26T07:27:58.939521 #14419] ERROR -- : Health check failure for https://ws.golos.io: #

and it gives that text again and again in endless/ but if restart app it is work good until it give this error again/// Why it becomes endless loop? 2017-11-26 07-42-33

inertia186 commented 6 years ago

I don't believe this is a bug in radiator. Rather, I believe this is caused by having too many files open in another part of the app. Radiator is just trying to open the SSL certificate and the OS cannot allocate resources.

When this happens, try running this from the command line:

lsof | awk '{ print $2; }' | uniq -c | sort -rn | head

It will tell you which PID has the most files open.

Nerossoul commented 6 years ago

OK i will try this command/// But for the future is it possible to break this cycle and get control to my app back?

Nerossoul commented 6 years ago

so, i got this error again lsof | awk '{ print $2; }' | uniq -c | sort -rn | head gives me this 2017-11-26 21-13-33 it's told me that chromium_browse has the most files open so i closed chromium 2017-11-26 21-27-52 and other PIDs was killed (all thats not ruby) BUT ALL MY ACTIONS NOT BREAK ENDLESS LOOP Please help!

inertia186 commented 6 years ago

I have added a possible fix when your computer runs out of resources and cannot open files. But it's better not to run out of resources (as of c933d62d268207d3330308d3c1870861b473b4f7).

I have another fix coming up that should help the garbage collector keep up in these situations, but I haven't fully tested it yet.

To update your app to the latest version of radiator, typically you can just use bundler:

bundle update
Nerossoul commented 6 years ago

SO, problem not solved/// photo_2017-11-30_22-20-47

some of solutions here https://www.google.ru/search?q=SSL_connect+SYSCALL+returned%3D5+errno%3D0+state%3Derror%3A+certificate+verify+failed&oq=SSL_connect+SYSCALL+returned%3D5+errno%3D0+state%3Derror%3A+certificate+verify+failed&aqs=chrome..69i57.1239j0j7&client=ubuntu&sourceid=chrome&ie=UTF-8

i hope you can understand what to do. help me.

inertia186 commented 6 years ago

The problem is not in radiator. Whatever you're doing requires more resources than you have. Maybe you can troubleshoot it by turning off SSL Verify.

https://stackoverflow.com/questions/1113422/how-to-bypass-ssl-certificate-verification-in-open-uri

Nerossoul commented 6 years ago

It is not good idea to turn off SSL Verify Can you give me control when this errors appears? just return response with this error/ i will decide how to get back resources... something like that

 just count ssl errors >5 
response = error text
return response
inertia186 commented 6 years ago

You're trying to troubleshoot radiator, but the problem is not in radiator. I cannot troubleshoot your app.

inertia186 commented 6 years ago

Another option for you is to avoid persistent HTTP by passing persist: false.

Doing this will impact performance because each API call will be a separate socket call. All of the constructors accept persist: false., e.g.:

api = Radiator::Api.new(chain: :golos, persist: false)

... or ...

stream = Radiator::Stream.new(chain: :golos, persist: false)

... or ...

tx = Radiator::Transaction.new(options.merge(persist: false, wif: wif))
Nerossoul commented 6 years ago

Great!!! it works persist: false changes situation 48 hours my errors count shows 0. thx for your help!