-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
rediscluster crashed when using as session handler #618
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
Comments
Hey, Thanks for the report! I just pushed this last night and it's not well tested yet. All I did was run a few little test scripts and didn't see any crashing on my end. That being said, I'm running the tests via php-cli (not fpm), so that could be a difference. I'll try to semi-replicate the way you're calling it and see if I can get lucky and crash it! If I can't get it to break, I'll do the work to run it via fpm and if it still doesn't break might bother you for a call stack. Cheers |
I tested it with settings similar to what you provided (just changed the IPs to 127.0.0.1), and didn't have any problems. I also ran it through valgrind without any warnings. Are the scripts you're using to run it simple enough to paste (or even just a simple script where you can get it to crash?) For example, if you put these three scripts into a directory and run ses-std.php: <?php
ini_se
8000
t('session.save_handler', 'rediscluster');
ini_set('session.save_path', 'seed[]=127.0.0.1:7000&seed[]=127.0.0.1:7001&seed[]=127.0.0.1:7002&timeout=3&read_time=3&prefix=sess');
session_id('my_session_id');
?> ses-in.php: <?php
require_once('ses-std.php');
session_start();
for ($i = 0; $i < 100; $i++) {
$_SESSION['var-'.$i] = 'my_special_value:' . $i . (isset($argv[1]) ? '-c' : '');
}
?> ses-out.php: <?php
require_once('ses-std.php');
session_start();
for ($i = 0; $i < 100; $i++) {
var_dump($_SESSION['var-'.$i]);
}
?> |
Hi, Mike, Thanks a lot for your quick turnaround and I tried your excerpt but it still crashed. I pasted the stacktrace and hope that might help: Reading symbols from /home/admin/fpm-php/lib/php/extensions/no-debug-non-zts-20100525/yaf.so...done. (gdb)since it seems mattering with the encoding stuff ( I am from China and not sure whether timezone or locale settings caused the problem), I pasted my locale as follows: btw, my php uses yaf and not sure whether it conflicts with redis. Just let me know if you need further info for troubleshooting. Thanks again |
More comes: I commented out the yaf in php.ini just in case and crash still happens. So yaf should not be the problem. |
Hey, thanks for the update. What version of php are you running? Sometimes these things come down to specific differences between them. Also I have a couple of questions. First, have you tried this same script using the standard 'redis' session handler? I'm curious to see if that also causes a crash, which would tend to rule out the cluster functionality specifically. The callstack in question doesn't contain any of the phpredis routines, but it still could be the module (in the case where I'm corrupting memory somehow in initialization). One thing that's always a good thing to do is run a full If that doesn't solve the problem, you could also run the script I posted through valgrind which should report any place where phpredis might be performing invalid read/write operations or operating on uninitialized values. Also there are other people who are going to be testing this functionality very soon, so if they have issues that might help narrow down the issue. Cheers, |
Hi, I made a quick double-check as you mentioned:
Thanks a lot for your nice help :-) |
Just an update: It seems the core only occurs to php 5.4.xx (I used the version php-5.4.42 for the testing). For php 5.6.xx, everything goes well. Would you please take a look at this since I am a fresh man for php source code? Thanks |
Hi,
it's great to find that redis cluster is supported for session handler which I searched for a long time. But it crashed for my first run after I compiled your latest version on dev branch. The following is my config:
session.save_handler = rediscluster
session.save_path = "seed[]=10.206.212.14:6382&seed[]=10.206.212.15:6382&seed[]=10.206.212.17:6386&seed[]=10.206.212.18:6386&timeout=3&read_time=3&prefix=sess"
==== error log ====
[18-Jun-2015 21:23:02] WARNING: [pool www] child 30732 exited on signal 11 (SIGSEGV) after 177.730814 seconds from start
[18-Jun-2015 21:23:02] NOTICE: [pool www] child 31187 started
would you please advise if this is a known issue or caused by my incorrect configuration since my project is eager for the feature?
Moreover, when would the cluster supported session handler be released?
Thanks
Daniel
The text was updated successfully, but these errors were encountered: