1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-14 06:12:50 +00:00

Ignore 'need_idx_progress' parameter when handling upload requests.

There is a bug in cloud file browser that can cause high number of concurrent uploads.

Also reduce the number retries when updating head commit in db.
This commit is contained in:
Jonathan Xu
2018-12-08 11:37:54 +08:00
parent e1ce4e6d17
commit ef362bda37
3 changed files with 7 additions and 7 deletions

View File

@@ -892,7 +892,7 @@ fast_forward_or_merge (const char *repo_id,
SeafCommit *base,
SeafCommit *new_commit)
{
#define MAX_RETRY_COUNT 10
#define MAX_RETRY_COUNT 3
SeafRepo *repo = NULL;
SeafCommit *current_head = NULL, *merged_commit = NULL;

View File

@@ -453,7 +453,7 @@ gen_new_commit (const char *repo_id,
char *new_commit_id,
GError **error)
{
#define MAX_RETRY_COUNT 10
#define MAX_RETRY_COUNT 3
SeafRepo *repo = NULL;
SeafCommit *new_commit = NULL, *current_head = NULL, *merged_commit = NULL;
@@ -585,8 +585,7 @@ retry:
goto retry;
} else {
seaf_warning ("Too many retries for concurrent update on repo %s. Stop retrying.\n",
repo_id);
seaf_warning ("Stop updating repo %s after %d retries.\n", repo_id, MAX_RETRY_COUNT);
g_set_error (error, SEAFILE_DOMAIN, SEAF_ERR_GENERAL, "Concurrent update");
ret = -1;
goto out;

View File

@@ -2340,9 +2340,10 @@ upload_headers_cb (evhtp_request_t *req, evhtp_headers_t *hdr, void *arg)
fsm->line = evbuffer_new ();
fsm->form_kvs = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, g_free);
const char *need_idx_progress = evhtp_kv_find (req->uri->query, "need_idx_progress");
if (g_strcmp0(need_idx_progress, "true") == 0)
fsm->need_idx_progress = TRUE;
/* const char *need_idx_progress = evhtp_kv_find (req->uri->query, "need_idx_progress"); */
/* if (g_strcmp0(need_idx_progress, "true") == 0) */
/* fsm->need_idx_progress = TRUE; */
fsm->need_idx_progress = FALSE;
if (progress_id != NULL) {
progress = g_new0 (Progress, 1);