List repo pending



Sometimes Loading repository very slowly. List builds query pending but I curl the list API everything ok.

{“log”:"\u001b[37mDEBU\u001b[0m[15597] events: stream cancelled \u001b[37mrequest-id\u001b[0m=1hXJaKapvBvgI8qU3oCZAbbydEy \u001b[37muser.login\u001b[0m=fanux\n",“stream”:“stderr”,“time”:“2020-09-15T06:46:59.656928286Z”}
{“log”:"\u001b[37mDEBU\u001b[0m[15597] events: stream closed \u001b[37mrequest-id\u001b[0m=1hXJaKapvBvgI8qU3oCZAbbydEy \u001b[37muser.login\u001b[0m=fanux\n",“stream”:“stderr”,“time”:“2020-09-15T06:46:59.656967949Z”}
{“log”:"\u001b[37mDEBU\u001b[0m[15597] \u001b[37mfields.time\u001b[0m=“2020-09-15T06:46:59Z” \u001b[37mlatency\u001b[0m=14m13.947417603s \u001b[37mmethod\u001b[0m=GET \u001b[37mremote\u001b[0m=“42.120.72.82:49983” \u001b[37mrequest\u001b[0m=/api/stream \u001b[37mrequest-id\u001b[0m=1hXJaKapvBvgI8qU3oCZAbbydEy\n",“stream”:“stderr”,“time”:“2020-09-15T06:46:59.656973628Z”}

/api/stream high latency caused list builds pending

/api/stream high latency caused list builds pending

Correlation does not imply causation. This endpoint is a SSE event stream [1] and is a long running HTTP request that behaves similar to a websocket. The request will stay open as long as you remain on the page. Therefore, high latency is expected and would not cause other API calls to hang.

[1] https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events

Yes SSE not caused the API calls to hang.

 curl 'http://100.67.146.228/api/repos/fanux/app' \
  -H 'Connection: keep-alive' \
  -H 'Pragma: no-cache' \
  -H 'Cache-Control: no-cache' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36' \
  -H 'Accept: */*' \
  -H 'Referer: http://100.67.146.228/fanux/app/' \
  -H 'Accept-Language: zh-CN,zh;q=0.9,en;q=0.8' \
  -H 'Cookie: _gothic_session=MTU5OTEyMjY0OHxOd3dBTkZGWVdWUTJURFZITlZwVU4wWkRXVEpIVlUxUFNrRklSa1JDVWs5TVF6ZFNORlZLVWxwRFRVRTNNMUZRUlRWUE4wMDFTMUU9fPvx9oqsERIZxQQobHX1Wev6LNZyzu0dw4UBflZNVtcm; SESSION=NjRjZjI3NTUtZTUyZC00NzFmLWI3NTMtNjYxN2VhNzQ1MDVh; lang=zh-CN; i_like_gitea=06b963e0b205d5be; _session_=X4e0jWZhbnV4ZG-2VpOvbVOo-QOHfcu6BaeuF8um6ZoAu18UAymXhbI=; _csrf=0uMqUYVb54YQBVnQJWU9UagqFY06MTYwMDE0MDg1OTY1MzcxODMxNg' \
  --compressed

This request will pending about 5min especially first time to open this page. But if I curl like this:

curl 'http://100.67.146.228/api/repos/fanux/app'

Will not pending. Could it be cause by authentication go gitea?

WARN[91546] api: cannot sync repository permissions admin=true error=“Get “http://100.67.146.228:4000/api/v1/repos/wb-ssy503401/slightshift_jenkins”: context canceled” name=slightshift_jenkins namespace=wb-ssy503401 read=true request-id=1hZp09kS9lcZe4TZ3QJ2B0yN0UV user.login=luanshaotong write=true
DEBU[91546] fields.time=“2020-09-16T03:52:49Z” latency=2m7.214924088s method=GET remote=“42.120.72.71:53803” request=/api/repos/wb-ssy503401/slightshift_jenkins request-id=1hZp09kS9lcZe4TZ3QJ2B0yN0UV
WARN[91547] api: cannot sync repository permissions admin=true error=“Get “http://100.67.146.228:4000/api/v1/repos/wb-ssy503401/slightshift_jenkins”: context canceled” name=slightshift_jenkins namespace=wb-ssy503401 read=true request-id=1hZp0BlmwlodOJzjUp2gMIPFBor user.login=luanshaotong write=true