add more log for easy debug & track connection state#92
add more log for easy debug & track connection state#92MOON-CLJ wants to merge 1 commit intodouban:masterfrom
Conversation
| dispatchRetrieval(GET_OP, keys, keyLens, nKeys); | ||
| err_code_t rv = waitPoll(); | ||
| collectRetrievalResult(results, nResults); | ||
| log_info_if(rv != RET_OK, "[I: %p], err code %s", this, errCodeToString(rv)); |
There was a problem hiding this comment.
AFAICS, it's no need to add log here, because the user can get rv and client outside.
| if (m_deadUntil > 0) { | ||
| log_info("Connection %s is back to live at %lu", m_name, now); | ||
| } | ||
| log_info_if(m_deadUntil > 0, "[I: %p] %s is back to live at %lu", this, m_name, now); |
There was a problem hiding this comment.
Connection m_name seems better than [I: pointer]
There was a problem hiding this comment.
@tclh123 https://github.com/douban/libmc/blob/master/src/Connection.cpp#L49-L52 m_name is "host:port" or alias。it's readable。but when need to debug & track reconnecting,pointer address is useful。
5e83afa to
3850172
Compare
|
Could you add more details on why we need this? I know this is good, but we need background and reasons to help us track down issues. |
|
@mckelvin this pr add some log in info level。specially, pointer address of "this" is new。pointer address is useful to track reconnecting,host:port or alias is not enough。these logs help us discover the recv_error issue cause by server kick connections because of idle_timeout。 |
deps on #79