Merge pull request #17848 from taosdata/fix/handleTcpExcept
fix: handle tcp except
This commit is contained in:
commit
794bca7974
|
@ -152,7 +152,7 @@ IFileCtx* idxFileCtxCreate(WriterType type, const char* path, bool readOnly, int
|
|||
if (ctx->type == TFILE) {
|
||||
// ugly code, refactor later
|
||||
ctx->file.readOnly = readOnly;
|
||||
memcpy(ctx->file.buf, path, sizeof(ctx->file.buf));
|
||||
memcpy(ctx->file.buf, path, strlen(path));
|
||||
if (readOnly == false) {
|
||||
ctx->file.pFile = taosOpenFile(path, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_APPEND);
|
||||
taosFtruncateFile(ctx->file.pFile, 0);
|
||||
|
|
|
@ -718,8 +718,10 @@ static void cliSendCb(uv_write_t* req, int status) {
|
|||
if (status == 0) {
|
||||
tTrace("%s conn %p data already was written out", CONN_GET_INST_LABEL(pConn), pConn);
|
||||
} else {
|
||||
tError("%s conn %p failed to write:%s", CONN_GET_INST_LABEL(pConn), pConn, uv_err_name(status));
|
||||
cliHandleExcept(pConn);
|
||||
if (!uv_is_closing((uv_handle_t*)&pConn->stream)) {
|
||||
tError("%s conn %p failed to write:%s", CONN_GET_INST_LABEL(pConn), pConn, uv_err_name(status));
|
||||
cliHandleExcept(pConn);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (cliHandleNoResp(pConn) == true) {
|
||||
|
|
|
@ -363,9 +363,11 @@ void uvOnSendCb(uv_write_t* req, int status) {
|
|||
}
|
||||
transUnrefSrvHandle(conn);
|
||||
} else {
|
||||
tError("conn %p failed to write data, %s", conn, uv_err_name(status));
|
||||
conn->broken = true;
|
||||
transUnrefSrvHandle(conn);
|
||||
if (!uv_is_closing((uv_handle_t*)(conn->pTcp))) {
|
||||
tError("conn %p failed to write data, %s", conn, uv_err_name(status));
|
||||
conn->broken = true;
|
||||
transUnrefSrvHandle(conn);
|
||||
}
|
||||
}
|
||||
}
|
||||
static void uvOnPipeWriteCb(uv_write_t* req, int status) {
|
||||
|
|
Loading…
Reference in New Issue