Skip to content

Log cause when memcached error occurs #170

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Log cause when memcached error occurs
Log the actual Memcached error when an warning is triggered, to
facilitate troubleshooting.
  • Loading branch information
krallin committed Apr 29, 2015
commit 31b05d8c4b755b1433bc7573ecaff7c720738688
4 changes: 3 additions & 1 deletion php_memcached_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static int php_memc_sess_lock(memcached_st *memc, const char *key TSRMLS_DC)
write_retry_attempts--;
continue;
}
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Write of lock failed");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Memcached: Write of lock failed, last error was: %s", memcached_strerror(memc, status));
break;
}

Expand Down Expand Up @@ -322,6 +322,7 @@ PS_READ_FUNC(memcached)
free(payload);
return SUCCESS;
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Memcached: Failed to read session data, last error was: %s", memcached_strerror(memc_sess->memc_sess, status));
return FAILURE;
}
}
Expand Down Expand Up @@ -360,6 +361,7 @@ PS_WRITE_FUNC(memcached)
}
} while (write_try_attempts > 0);

php_error_docref(NULL TSRMLS_CC, E_WARNING, "Memcached: Failed to write session data, last error was: %s", memcached_strerror(memc_sess->memc_sess, status));
return FAILURE;
}

Expand Down