Fix Multiple Request for PHP (#7008)
* Add scripts to test multirequest * chmod ug+x multirequest.sh * Add continuous test * Compile c extension * Class entry is obsolete in the second request 1) Needes to use class name in persistent map 2) Invalidate class entry stored in descriptor * Add new files to dist * Fix compile_extension * Cleanup outputs for phpizepull/7019/head v3.11.2
parent
39492b68d8
commit
fe1790ca0d
8 changed files with 133 additions and 21 deletions
@ -0,0 +1,8 @@ |
||||
<?php |
||||
|
||||
if (extension_loaded("protobuf")) { |
||||
require_once('memory_leak_test.php'); |
||||
echo "<p>protobuf loaded</p>"; |
||||
} else { |
||||
echo "<p>protobuf not loaded</p>"; |
||||
} |
@ -0,0 +1,34 @@ |
||||
#!/bin/bash |
||||
set -e |
||||
|
||||
# Compile c extension |
||||
VERSION=7.4 |
||||
PORT=12345 |
||||
|
||||
export PATH=/usr/local/php-$VERSION/bin:$PATH |
||||
export C_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$C_INCLUDE_PATH |
||||
export CPLUS_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$CPLUS_INCLUDE_PATH |
||||
/bin/bash ./compile_extension.sh $VERSION |
||||
|
||||
nohup php -d protobuf.keep_descriptor_pool_after_request=1 -dextension=../ext/google/protobuf/modules/protobuf.so -S localhost:$PORT multirequest.php 2>&1 & |
||||
|
||||
sleep 1 |
||||
|
||||
wget http://localhost:$PORT/multirequest.result -O multirequest.result |
||||
wget http://localhost:$PORT/multirequest.result -O multirequest.result |
||||
|
||||
pushd ../ext/google/protobuf |
||||
phpize --clean |
||||
popd |
||||
|
||||
PID=`ps | grep "php" | awk '{print $1}'` |
||||
echo $PID |
||||
|
||||
if [[ -z "$PID" ]] |
||||
then |
||||
echo "Failed" |
||||
exit 1 |
||||
else |
||||
kill $PID |
||||
echo "Succeeded" |
||||
fi |
Loading…
Reference in new issue