-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Gitea doesn't open more than 5 tabs in browser #11978
Comments
can't reproduce in https://gitea.com |
Updated description. |
@lakostin |
I have this isssue on multiple instances and even on different versions. All served by docker btw |
Can confirm, opening any new tabs after 6 have loaded for me results in awaiting for socket. Hosting on Docker as well. |
I had same issue here, just after updating to v1.12. CPU usage stays at typical level, logs shows that database (MySQL in my case) also respond in typical time. Now I've just figured out, that restarting gitea didn't solved problem, but restarting proxy (apache2) does. After restarting I cannot now reproduce it 👎 @lakostin are you using proxy at front of gitea? |
@dexterxx-pl Tried restarting my proxy in front of gitea to no effect. |
I think it is related to events endpoint that uses sockets for getting events about new notifications. We should probably somehow limit sockets count per user probably |
Same problem. But I could not reproduce this issue without a reverse proxy server (nginx in my case). UPD: Using http2 in nginx solved the problem |
Yeah I suspect this is EventSource issues. |
So I don't think this is the server holding things up but rather the browser. It looks like Firefox is blocking instead of just failing out. |
I can confirm this. It happened first after upgrading to 1.12. I am running gitea on Windows 10 2004 with an apache reverse proxy on Ubuntu 18.04. I am able to reproduce this with Firefox and Chrome. |
Can anyone reproduce this on try? |
It seems I do. Both in Firefox and in Chromium. I just have to Login and from the Dashboard open multiple commits in tabs. If then I click on "View source" it will not load until I close enough(about 5 tabs are left open) tabs. It seems to be about 5 tabs in each browser, as I could test Chromium while Firefox tabs were still open. |
Reproduced also in Gitea Version: 1.12.1 running with systemd. |
Also Reproducible version: 1.12.1
|
This also happens while normally browsing Gitea, you do not need to open 5 different tabs at the same time. I have ran into this problem just by navigating through my commits and repository files, and have been running into it since at least version 1.11. I am now using 1.12.1 with the same identical problem. Gitea is running behind an Apache2 reverse proxy, no docker. MySQL database. Ubuntu 20.04 LTS. |
I can also reproduce this (on gitea 1.12.1), the I've patched my own gitea to disable javascript going to |
I was seeing this issue in Firefox / Gitea 1.12.1, clicking around gitea a bunch would eventually cause requests to hang and never complete, essentially freezing the app. I noticed in the network debugger a lot of the requests were being fulfilled by the Service Worker. I was able to fix my issue by going into |
Same here with Firefox and Chrome too. |
Sorry about this. This one is my fault. There is a workaround:
I've finally managed to hack up a fix and will push up a PR to push the EventSource stuff into a SharedWorker but it will need review. Unfortunately the setting doesn't work due to a misunderstanding on my behalf. My suspicion was the EventSource would not open if you hit the tab limit not - that it would prevent opening new tabs - and although I tested with opening multiple tabs it didn't cause these problems. This code has been part of master for quite some time - I don't understand why it was only on release of Gitea 1.12 that this problem was noticed. Presumably try runs on HTTP/2.0? |
EDIT: Looks like Firefox had cached some settings. I was still using HTTP 1.1 with my old session, however in incognito mode (and thus clearing the cookies too) switched me to HTTP 2.0, fixing the problem. Very weird, since my server allows HTTP 2.0 connections and I still manage to have this issue... Are you sure about the second fix? I'm starting to doubt that my configuration could be faulty, even though the Firefox dev console says I'm using HTTP 2.0... |
Doesn't appear to work for me, not sure if I just did something wrong.. Will try and figure out switching to HTTP/2.0. |
Move EventSource to use a SharedWorker. This prevents issues with HTTP/1.1 open browser connections from preventing gitea from opening multiple tabs. Also adds several options to control this. Fix go-gitea#11978 Signed-off-by: Andrew Thornton <art27@cantab.net>
@ChaseHall try -1 instead of 0? |
@zeripath -1 just results in a 503. Nothing useful in docker logs about it.. |
I can second that, same issues as @ChaseHall |
@ChaseHall @42wim - sorry you're right - that's another bug with this too. 😞 |
OK #12095 will fix that too. Setting |
Move EventSource to use a SharedWorker. This prevents issues with HTTP/1.1 open browser connections from preventing gitea from opening multiple tabs. Also allow setting EVENT_SOURCE_UPDATE_TIME to disable EventSource updating Fix #11978 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Backport go-gitea#12095 Move EventSource to use a SharedWorker. This prevents issues with HTTP/1.1 open browser connections from preventing gitea from opening multiple tabs. Also allow setting EVENT_SOURCE_UPDATE_TIME to disable EventSource updating Fix go-gitea#11978 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Move EventSource to SharedWorker (#12095) Backport #12095 Move EventSource to use a SharedWorker. This prevents issues with HTTP/1.1 open browser connections from preventing gitea from opening multiple tabs. Also allow setting EVENT_SOURCE_UPDATE_TIME to disable EventSource updating Fix #11978 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io> * Bugfix for shared event source For some reason our eslint configuration is not working correctly and a bug has become apparent when trying to backport this to 1.12. Signed-off-by: Andrew Thornton <art27@cantab.net> * Re-fix #12095 again Unfortunately some of the suggested changes to #12095 introduced bugs which due to caching behaviour of sharedworkers were not caught on simple tests. These are as follows: * Changing from simple for loop to use includes here: ```js register(port) { if (!this.clients.includes(port)) return; this.clients.push(port); port.postMessage({ type: 'status', message: `registered to ${this.url}`, }); } ``` The additional `!` prevents any clients from being added and should read: ```js if (this.clients.includes(port)) return; ``` * Dropping the use of jQuery `$(...)` selection and using DOM `querySelector` here: ```js async function receiveUpdateCount(event) { try { const data = JSON.parse(event.data); const notificationCount = document.querySelector('.notification_count'); if (data.Count > 0) { notificationCount.classList.remove('hidden'); } else { notificationCount.classList.add('hidden'); } notificationCount.text() = `${data.Count}`; await updateNotificationTable(); } catch (error) { console.error(error, event); } } ``` Requires that `notificationCount.text()` be changed to use `textContent` instead. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Move EventSource to use a SharedWorker. This prevents issues with HTTP/1.1 open browser connections from preventing gitea from opening multiple tabs. Also allow setting EVENT_SOURCE_UPDATE_TIME to disable EventSource updating Fix go-gitea#11978 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
1.12.0
2.17.1
Ubuntu 18.04.3 LTS
[x]
):Description
I open pull request with multiple commits, then i open 5 new tabs in browser with each commit. Everything is ok. When i open the sixth tab and further they hang with message "Waiting for available socket..." until i close one of the previously opened tabs.
It can be reproduced in any browser.
What can this be connected to?
Screenshots
The text was updated successfully, but these errors were encountered: