add trace log
This commit is contained in:
parent
feb23ba56b
commit
bef98f4787
|
@ -197,14 +197,14 @@ static FORCE_INLINE int32_t taosBuildDstAddr(const char* server, uint16_t port,
|
|||
uint32_t ip = 0;
|
||||
int32_t code = taosGetIpv4FromFqdn(server, &ip);
|
||||
if (code) {
|
||||
tError("http-report failed to resolving domain names: %s", server);
|
||||
tError("http-report failed to resolving domain names %s, reason: %s", server, tstrerror(code));
|
||||
return TSDB_CODE_RPC_FQDN_ERROR;
|
||||
}
|
||||
char buf[256] = {0};
|
||||
tinet_ntoa(buf, ip);
|
||||
int ret = uv_ip4_addr(buf, port, dest);
|
||||
if (ret != 0) {
|
||||
tError("http-report failed to get addr %s", uv_err_name(ret));
|
||||
tError("http-report failed to get addr, reason:%s", uv_err_name(ret));
|
||||
return TSDB_CODE_THIRDPARTY_ERROR;
|
||||
}
|
||||
return 0;
|
||||
|
@ -267,7 +267,7 @@ static void httpDestroyMsg(SHttpMsg* msg) {
|
|||
}
|
||||
static void httpDestroyMsgWrapper(void* cont, void* param) {
|
||||
SHttpMsg* pMsg = cont;
|
||||
tWarn("http-report destroy msg, seq: %" PRId64 "", pMsg->seq);
|
||||
tWarn("http-report destroy msg, chanId:%" PRId64 ", seq:%" PRId64 "", pMsg->chanId, pMsg->seq);
|
||||
httpDestroyMsg(pMsg);
|
||||
}
|
||||
|
||||
|
@ -309,7 +309,7 @@ static void httpTrace(queue* q) {
|
|||
msg = QUEUE_DATA(h, SHttpMsg, q);
|
||||
endSeq = msg->seq;
|
||||
|
||||
tDebug("http-report process msg, start_seq: %" PRId64 ", end_seq: %" PRId64 ", max_seq:%" PRId64 "", startSeq, endSeq,
|
||||
tDebug("http-report process msg, start_seq:%" PRId64 ", end_seq:%" PRId64 ", max_seq:%" PRId64 "", startSeq, endSeq,
|
||||
atomic_load_64(&httpSeqNum) - 1);
|
||||
}
|
||||
|
||||
|
@ -380,9 +380,9 @@ static FORCE_INLINE void clientAllocBuffCb(uv_handle_t* handle, size_t suggested
|
|||
static FORCE_INLINE void clientRecvCb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) {
|
||||
SHttpClient* cli = handle->data;
|
||||
if (nread < 0) {
|
||||
tError("http-report recv error:%s, seq: %" PRId64 "", uv_strerror(nread), cli->seq);
|
||||
tError("http-report recv error:%s, seq:%" PRId64 "", uv_strerror(nread), cli->seq);
|
||||
} else {
|
||||
tTrace("http-report succ to recv %d bytes, seq: %" PRId64 "", (int32_t)nread, cli->seq);
|
||||
tTrace("http-report succ to recv %d bytes, seq:%" PRId64 "", (int32_t)nread, cli->seq);
|
||||
}
|
||||
if (!uv_is_closing((uv_handle_t*)&cli->tcp)) {
|
||||
uv_close((uv_handle_t*)&cli->tcp, clientCloseCb);
|
||||
|
@ -391,18 +391,18 @@ static FORCE_INLINE void clientRecvCb(uv_stream_t* handle, ssize_t nread, const
|
|||
static void clientSentCb(uv_write_t* req, int32_t status) {
|
||||
SHttpClient* cli = req->data;
|
||||
if (status != 0) {
|
||||
tError("http-report failed to send data, reason: %s, dst:%s:%d, chanId:%" PRId64 ", seq: %" PRId64 "",
|
||||
tError("http-report failed to send data, reason: %s, dst:%s:%d, chanId:%" PRId64 ", seq:%" PRId64 "",
|
||||
uv_strerror(status), cli->addr, cli->port, cli->chanId, cli->seq);
|
||||
if (!uv_is_closing((uv_handle_t*)&cli->tcp)) {
|
||||
uv_close((uv_handle_t*)&cli->tcp, clientCloseCb);
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
tTrace("http-report succ to send data, chanId:%" PRId64 ", seq: %" PRId64 "", cli->chanId, cli->seq);
|
||||
tTrace("http-report succ to send data, chanId:%" PRId64 ", seq:%" PRId64 "", cli->chanId, cli->seq);
|
||||
}
|
||||
status = uv_read_start((uv_stream_t*)&cli->tcp, clientAllocBuffCb, clientRecvCb);
|
||||
if (status != 0) {
|
||||
tError("http-report failed to recv data,reason:%s, dst:%s:%d, chanId:%" PRId64 ", seq: %" PRId64 "",
|
||||
tError("http-report failed to recv data,reason:%s, dst:%s:%d, chanId:%" PRId64 ", seq:%" PRId64 "",
|
||||
uv_strerror(status), cli->addr, cli->port, cli->chanId, cli->seq);
|
||||
if (!uv_is_closing((uv_handle_t*)&cli->tcp)) {
|
||||
uv_close((uv_handle_t*)&cli->tcp, clientCloseCb);
|
||||
|
@ -416,7 +416,7 @@ static void clientConnCb(uv_connect_t* req, int32_t status) {
|
|||
SHttpModule* http = taosAcquireRef(httpRefMgt, chanId);
|
||||
if (status != 0) {
|
||||
httpFailFastMayUpdate(http->connStatusTable, cli->addr, cli->port, 0);
|
||||
tError("http-report failed to conn to server, reason:%s, dst:%s:%d, chanId:%" PRId64 ", seq: %" PRId64 "",
|
||||
tError("http-report failed to conn to server, reason:%s, dst:%s:%d, chanId:%" PRId64 ", seq:%" PRId64 "",
|
||||
uv_strerror(status), cli->addr, cli->port, chanId, cli->seq);
|
||||
if (!uv_is_closing((uv_handle_t*)&cli->tcp)) {
|
||||
uv_close((uv_handle_t*)&cli->tcp, clientCloseCb);
|
||||
|
@ -430,7 +430,7 @@ static void clientConnCb(uv_connect_t* req, int32_t status) {
|
|||
|
||||
status = uv_write(&cli->req, (uv_stream_t*)&cli->tcp, cli->wbuf, 2, clientSentCb);
|
||||
if (0 != status) {
|
||||
tError("http-report failed to send data,reason:%s, dst:%s:%d, chanId:%" PRId64 ", seq: %" PRId64 "",
|
||||
tError("http-report failed to send data,reason:%s, dst:%s:%d, chanId:%" PRId64 ", seq:%" PRId64 "",
|
||||
uv_strerror(status), cli->addr, cli->port, chanId, cli->seq);
|
||||
if (!uv_is_closing((uv_handle_t*)&cli->tcp)) {
|
||||
uv_close((uv_handle_t*)&cli->tcp, clientCloseCb);
|
||||
|
@ -478,7 +478,7 @@ static void httpHandleQuit(SHttpMsg* msg) {
|
|||
int64_t chanId = msg->chanId;
|
||||
taosMemoryFree(msg);
|
||||
|
||||
tDebug("http-report receive quit, chanId: %" PRId64 ", seq: %" PRId64 "", chanId, seq);
|
||||
tDebug("http-report receive quit, chanId:%" PRId64 ", seq:%" PRId64 "", chanId, seq);
|
||||
SHttpModule* http = taosAcquireRef(httpRefMgt, chanId);
|
||||
if (http == NULL) return;
|
||||
uv_walk(http->loop, httpWalkCb, NULL);
|
||||
|
@ -589,7 +589,7 @@ static void httpHandleReq(SHttpMsg* msg) {
|
|||
cli->wbuf = wb;
|
||||
cli->rbuf = taosMemoryCalloc(1, HTTP_RECV_BUF_SIZE);
|
||||
if (cli->rbuf == NULL) {
|
||||
tError("http-report failed to alloc read buf, dst:%s:%d,chanId:%" PRId64 ", seq:%" PRId64 ",reason:%s", cli->addr,
|
||||
tError("http-report failed to alloc read buf, dst:%s:%d, chanId:%" PRId64 ", seq:%" PRId64 ",reason:%s", cli->addr,
|
||||
cli->port, chanId, cli->seq, tstrerror(TSDB_CODE_OUT_OF_MEMORY));
|
||||
destroyHttpClient(cli);
|
||||
(void)taosReleaseRef(httpRefMgt, chanId);
|
||||
|
@ -598,7 +598,7 @@ static void httpHandleReq(SHttpMsg* msg) {
|
|||
|
||||
int err = uv_tcp_init(http->loop, &cli->tcp);
|
||||
if (err != 0) {
|
||||
tError("http-report failed to init socket handle, dst:%s:%d,chanId:%" PRId64 ", seq:%" PRId64 ", reason:%s",
|
||||
tError("http-report failed to init socket handle, dst:%s:%d, chanId:%" PRId64 ", seq:%" PRId64 ", reason:%s",
|
||||
cli->addr, cli->port, chanId, cli->seq, uv_strerror(err));
|
||||
destroyHttpClient(cli);
|
||||
(void)taosReleaseRef(httpRefMgt, chanId);
|
||||
|
@ -617,8 +617,9 @@ static void httpHandleReq(SHttpMsg* msg) {
|
|||
|
||||
int ret = uv_tcp_open((uv_tcp_t*)&cli->tcp, fd);
|
||||
if (ret != 0) {
|
||||
tError("http-report failed to open socket, reason:%s, dst:%s:%d, chanId:%" PRId64 ", seq:%" PRId64 ", reason:%s",
|
||||
uv_strerror(ret), cli->addr, cli->port, chanId, cli->seq, uv_strerror(ret));
|
||||
tError("http-report failed to open socket, dst:%s:%d, chanId:%" PRId64 ", seq:%" PRId64 ", reason:%s", cli->addr,
|
||||
cli->port, chanId, cli->seq, uv_strerror(ret));
|
||||
|
||||
destroyHttpClient(cli);
|
||||
(void)taosReleaseRef(httpRefMgt, chanId);
|
||||
return;
|
||||
|
@ -626,7 +627,7 @@ static void httpHandleReq(SHttpMsg* msg) {
|
|||
|
||||
ret = uv_tcp_connect(&cli->conn, &cli->tcp, (const struct sockaddr*)&cli->dest, clientConnCb);
|
||||
if (ret != 0) {
|
||||
tError("http-report failed to connect to http-server,dst:%s:%d, chanId:%" PRId64 ", seq:%" PRId64 ",reson:%s",
|
||||
tError("http-report failed to connect to http-server,dst:%s:%d, chanId:%" PRId64 ", seq:%" PRId64 ", reson:%s",
|
||||
cli->addr, cli->port, chanId, cli->seq, uv_strerror(ret));
|
||||
httpFailFastMayUpdate(http->connStatusTable, cli->addr, cli->port, 0);
|
||||
destroyHttpClient(cli);
|
||||
|
@ -685,7 +686,7 @@ static int32_t taosSendHttpReportImplByChan(const char* server, const char* uri,
|
|||
code = TSDB_CODE_HTTP_MODULE_QUIT;
|
||||
goto _ERROR;
|
||||
}
|
||||
tDebug("http-report start to report,chanId:%" PRId64 ", seq:%" PRId64 "", chanId, msg->seq);
|
||||
tDebug("http-report start to report, chanId:%" PRId64 ", seq:%" PRId64 "", chanId, msg->seq);
|
||||
|
||||
code = transAsyncSend(load->asyncPool, &(msg->q));
|
||||
if (code != 0) {
|
||||
|
@ -788,7 +789,7 @@ int64_t taosInitHttpChan() {
|
|||
}
|
||||
|
||||
void taosDestroyHttpChan(int64_t chanId) {
|
||||
tDebug("http-report send quit, chanId:%" PRId64 "", chanId);
|
||||
tDebug("http-report send quit, chanId: %" PRId64 "", chanId);
|
||||
|
||||
int ret = 0;
|
||||
SHttpModule* load = taosAcquireRef(httpRefMgt, chanId);
|
||||
|
|
Loading…
Reference in New Issue