-
Notifications
You must be signed in to change notification settings - Fork 10
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
Can't use string ("eof") as a SCALAR ref while "strict refs" in use at .../Gearman/ResponseParser.pm line 175. #50
Comments
Hmmm... After making the above change, I've eliminated the crashes, but I think |
Hi Ed, it's a while I've read Perl code. I suppose the problem occurs if Gearman::Util::_read_sock ends with
Do I see that correctly that the condition of
|
Thanks for your reply, Alexei. I realize you've moved on from Perl programming, so I appreciate you taking the time. Let's say we change elsif ($ok == 0) {
return $err->($err_code);
} to elsif ($ok == 0 && $err_code ne "eof") {
return $err->($err_code);
} as you suggested. What happens in the case of Without testing, my thinking is we need to get out of the loop? Maybe with a "next" or "last"? elsif ($ok == 0) {
next if $err_code eq 'eof'; # or last?
return $err->($err_code);
} What do you think? |
Getting back to $self->on_error("read_error: $err");
Whether or not 'eof' should be considered an error condition and how 'eof' should be handled are separate issues. I've tested all of the following prospective changes in elsif ($ok == 0 && $err_code ne "eof") {
return $err->($err_code);
} This definitely doesn't work. Every task hangs. Next, I tried this: elsif ($ok == 0) {
next if $err_code eq "eof";
return $err->($err_code);
} This resulted in an infinite loop when "eof" is encountered. This seems to work well, but I'm not sure it's actually an improvement: elsif ($ok == 0) {
last if $err_code eq "eof";
return $err->($err_code);
} I still get the occasional hang (about one in 500 tasks). I turned on DEBUG and added a bunch of additional DEBUG statements to |
Hi Ed,
But independently from the Perl version the tests are hanging with gearman-job-server amd64 1.1.19.1 |
Do both of these happen all the time? Or is it just a rare random failure? I'm just seeing the rare random hang. Since yesterday, my testing would seem to indicate that this is due to a Perl worker getting pegged near 100% CPU. So it's not the client where the hang is happening, apparently. The client is just waiting for the job result as it should.
Well, 1.1.21 is the latest version of gearmand. There have been a lot of commits since 1.1.19.1, but I'm not sure what might be the cause there. |
Are you using case "${GITHUB_ACTIONS_CONTAINER}" in
ubuntu*)
apt-get -o update && DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 -y install iproute2
echo "==="
echo "Before: /etc/hosts"
cat /etc/hosts
echo "==="
echo "Removing localhost name from ::1 entry in /etc/hosts..."
sed 's/^::1\s\s*localhost\s\(.*\)/::1 \1/' /etc/hosts > /tmp/hosts.temp
cp /tmp/hosts.temp /etc/hosts
rm /tmp/hosts.temp
echo "After: /etc/hosts"
cat /etc/hosts
echo "==="
ip addr
echo "==="
echo "'hostname -i' shows '$(hostname -i)'"
echo "'hostname -I' shows '$(hostname -I)'"
echo "'hostname -s' shows '$(hostname -s)'"
echo "'hostname -f' shows '$(hostname -f)'"
;;
*)
;;
esac |
Hi, Alexei!
Job server failure: Can't use string ("eof") as a SCALAR ref while "strict refs" in use at .../Gearman/ResponseParser.pm line 175.
I saw this error twice recently when I was testing adding a large number of tasks to a task set, each with "on_complete" callbacks. The jobs when processed by workers also "set_status" to update a completion percentage. It happens very rarely, and I think I've only ever seen this error with jobs that "set_status".
Gearman::Util::_read_sock
can return the string "eof", of course, but I don't see how$err
inGearman::ResponseParser::parse_sock()
can be anything but a reference to a SCALAR? I'm not seeing the bug! Do you?But just to prevent crashes, I've changed
Gearman/ResponseParser.pm
line 175 to this:The text was updated successfully, but these errors were encountered: