Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Child FCGI process keeps respawning after each request #58

Open
Dweller opened this issue Feb 11, 2022 · 2 comments
Open

Child FCGI process keeps respawning after each request #58

Dweller opened this issue Feb 11, 2022 · 2 comments

Comments

@Dweller
Copy link

Dweller commented Feb 11, 2022

I've a nginx server which is passing requests via /var/run/fcgiwrap.socket

location /bin {
    root /var/www/;
    fastcgi_pass unix:/var/run/fcgiwrap.socket;
    include fastcgi_params;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
 }
My C program is calling FCGI_accept() in a while loop.
 while (FCGI_Accept() >= 0) {
    blah
   }

When I hit the nginx server with my request it works once then FCGI-Accept ruturns -1 and that means the process is respawning every time I make a request.

Is there a way to have tohave fcgiwrap honour the Accept for the next call?

@nikolaysu
Copy link

Join the question.

@nikolaysu
Copy link

up
while( !finish_process && FCGI_Accept() >= 0 ) { <-- first time FCGI_Accept() return 0.
a = FCGI_Accept();
msDebug("==FCGI_Accept on start== %d\n", a); <-- first time FCGI_Accept() return -1.

maybe you need to clear the request somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants