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

php-env only answers one request #146

Open
torblerone opened this issue Aug 31, 2021 · 5 comments
Open

php-env only answers one request #146

torblerone opened this issue Aug 31, 2021 · 5 comments
Labels
env-php PHP environment related issues

Comments

@torblerone
Copy link

torblerone commented Aug 31, 2021

Fission/Kubernetes version

$ fission version
client:
  fission/core:
    BuildDate: "2021-08-03T11:34:27Z"
    GitCommit: 9b5eb069d69d47d22ecc0270bf8619857ea3f19f
    Version: 1.14.1
server:
  fission/core:
    BuildDate: "2021-08-03T09:53:20Z"
    GitCommit: 9b5eb069d69d47d22ecc0270bf8619857ea3f19f
    Version: 1.14.1

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.2", GitCommit:"092fbfbf53427de67cac1e9fa54aaa09a28371d7", GitTreeState:"clean", BuildDate:"2021-06-16T12:59:11Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.3+k3s1", GitCommit:"1d1f220fbee9cdeb5416b76b707dde8c231121f2", GitTreeState:"clean", BuildDate:"2021-07-22T20:52:14Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}

Kubernetes platform (e.g. Google Kubernetes Engine)
k3s
Describe the bug

When I create a PHP environment like so:

$ fission env create --name php73 --builder "fission/php-builder" --version=2 --image "fission/php-env"

and deploy a basic function to it:

$ cat hello.php
<?php
echo "Hello from PHP";
$logger->warning("Hello logger");

$ fission fn create --name "phpnew" --code hello.php --method GET --env php73 

and then try to run it multiple times:

  $ for i in {1..100}
> do
> fission fn test --name phpnew
> sleep 1 && echo $i
> done

You can see in the output that the function does not get called cleanly everytime and often does not respond with the "Hello from PHP" as expected:

Hello from PHP1
2
3
4
5
6
7
8
9
10
11
Hello from PHP12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Hello from PHP32
33
^C

To Reproduce

Install fission via Helm (without Prometheus) as provided in the Official Documentation. Then do above steps.

Expected result

I want to make sure that every function call gets answered in a proper way. Thus, every call from above should be responded with "Hello from PHP".

Actual result

Only sporadically, the function gets called and I get a correct response.

Screenshots/Dump file

If needed, please tell me if you need a dump for this issue and what exact files are needed. I need to make sure that sensitive company informations are omitted.

Additional context

I noticed that everytime I get a correct response Hello from PHP, a new poolmgr Pod is being created. Maybe it's an issue that the PHP environment never closes the request properly and is only capable of answering exactly one request?

Edit: I've also tried it with your standard python-env and was not able to reproduce this issue there. It must have got to do something with that specific container image.

@sanketsudake sanketsudake added the env-php PHP environment related issues label Nov 25, 2021
@pehbehbeh
Copy link

pehbehbeh commented Feb 14, 2022

Same issue here.

$ fission version
client:
  fission/core:
    BuildDate: "2021-12-29T03:57:30Z"
    GitCommit: 327275d1
    Version: v1.15.1
server:
  fission/core:
    BuildDate: "2021-12-29T03:57:30Z"
    GitCommit: 327275d1
    Version: v1.15.1

We are using fission/php-env:1.31.1 as an environment image.

@torbendury
Copy link

Same thing happening to us unfortunately.

@checkin247
Copy link
Contributor

Had the same issue. Found the solution!

Function works exactly once per pod started.

in server.php
change:
require_once $codePath;
to
require $codePath;

@sanketsudake

@checkin247
Copy link
Contributor

@sanketsudake please check the pull request #292

@checkin247
Copy link
Contributor

there is also a PHP8.2 environment which has this issue fixed
https://github.com/checkin247/fission-environments/tree/php8-2

in case someone is interested, its a fork of the php7 environment.

sanketsudake pushed a commit that referenced this issue Jan 12, 2023
* fix php-env only answers one request #146

* fix empty response issue

* increase environment version to 1.31.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
env-php PHP environment related issues
Projects
None yet
Development

No branches or pull requests

5 participants