Skip to content
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

Add block missing sync error #2694

Merged
merged 2 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions daemon/http-tx-mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#define HTTP_REPO_DELETED 444
#define HTTP_REPO_TOO_LARGE 447
#define HTTP_REPO_CORRUPTED 445
#define HTTP_BLOCK_MISSING 446
#define HTTP_INTERNAL_SERVER_ERROR 500

#define RESET_BYTES_INTERVAL_MSEC 1000
Expand Down Expand Up @@ -1101,6 +1102,8 @@ http_error_to_http_task_error (int status)
return SYNC_ERROR_ID_SERVER_REPO_CORRUPT;
else if (status == HTTP_REPO_TOO_LARGE || status == HTTP_REQUEST_TIME_OUT)
return SYNC_ERROR_ID_LIBRARY_TOO_LARGE;
else if (status == HTTP_BLOCK_MISSING)
return SYNC_ERROR_ID_BLOCK_MISSING;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

想了一下,为了便于问题排查和处理,服务器端应该一次性把所有没有上传完整的文件名在 reponse body 中以 JSON 格式返回。客户端在日志中打印一下。

else
return SYNC_ERROR_ID_GENERAL_ERROR;
}
Expand Down
5 changes: 5 additions & 0 deletions daemon/seafile-error.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ static SyncErrorInfo sync_error_info_tbl[] = {
SYNC_ERROR_LEVEL_FILE,
"Failed to checkout file on the client. Please check disk space or folder permissions"
},
{
SYNC_ERROR_ID_BLOCK_MISSING,
SYNC_ERROR_LEVEL_REPO,
"Failed to upload file blocks. Please check network or firewall"
},
};

const char *
Expand Down
3 changes: 2 additions & 1 deletion include/seafile-error.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
#define SYNC_ERROR_ID_DEL_CONFIRMATION_PENDING 33
#define SYNC_ERROR_ID_TOO_MANY_FILES 34
#define SYNC_ERROR_ID_CHECKOUT_FILE 35
#define N_SYNC_ERROR_ID 36
#define SYNC_ERROR_ID_BLOCK_MISSING 36
#define N_SYNC_ERROR_ID 37

#endif