Closed liqites closed 9 years ago
Sorry man, stupid question. I think reason is bellow:
rails s
--> single processwkhtmltoimage
wkhtmltoimage
will load page, which means loading resource from rails
server.rails
process is waiting wkhtmltoimage
process to return to response my request.rails
process can handle the wkhtmltoimage
loading resource request.Dead Lock, LOL
I don't get it?! Is it solved? How?! I'm having similar problems here.
@phackwer
That's because at that time, year 2015. My rails s
only starts in single process mode.
Assumes that the only process called Process A
, the progress will be like this:
Process A
handle the request.Process A
, it calls IMGKit
to send another request to my rails
server to render view for generating image and it waits.Process A
is waiting and I do not have another process to handle the IMGKit
request.You need to start your rails s
server MULTIPLE PROCESSES or MULTIPLE THREADS mode
Hi @liqites . Well, I'm using the Phusion/Passenger docker container (https://github.com/phusion/passenger-docker). How can I check if this is happening?
I'm having the most unusual problem here: when running a docker container locally in development mode, that has IMGKit, my code runs smooth, and generates the images properly. But when we go to the QA server, the QA hangs in the second request. wkhtmltoimage seems to get stuck, with no hope to ever come back. If I go into the docker container and kill the process manually (killall wkhtmltoimage-amd64) rails start responding other requests.
Now: what is really bizarre: if I call the endpoints that generate the images directly from my browser, al go, all normal... There is nothing special on the headers, actually it's a pretty standard get with the token in the URL, so there should be no problem at all with it!
Also, the same code that generates the images is used in a different part of our system (as we created it as a concern to be used on different controllers), and they are all working fine!!!
@phackwer
Below is some more info I need to know for figuring out the question.
My Question is:
action
in controller
of your local development server?
If so, it still has a chance of hangs.
If not, then that is the reason why your local code works smooth.Question is:
action
in controller
of your QA?I can't determine the answer without those information.
Environment
Start server with
rails s
Using in Controller
Additional Information