-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
mkdocs serve --livereload
hangs, forces to CTRL-C and restart
#3389
Comments
Huh, some blockage does happen! - What I observe only in Chromium: - What I observe in Firefox and Chromium: And it's also really strange - the blockage is confined to 1 browser at a time, the other browser can look at the same server and work fine independently. |
Yes, the browser seems to have 10 active connections and refuses to open new ones. The only way to fix this is to free idle (= useless) connections, which I've proposed in #3391. #3390 fixes the problem when you use less than 6 tabs. The other problem with 6+ tabs was discovered and fixed later, which is why #3391 supersedes #3390. Nevertheless, I kept the old PR open to run it by you, because you seem to be not sure if it's okay to closing idle connections. |
mkdocs serve --livereload
mkdocs serve --livereload
hangs, forces to CTRL-C and restart
@oprypin could you share if you made progress on your evaluation whether merging #3391 is feasible? Feedback in #3391 by @ultrabug and @pawamoy, two other maintainers of this project, denotes that they, like me, don't regard it as a downside, and users can help themselves by installing a browser extension, if they want to reload inactive tabs. Other than that, is there a timeline for 1.6.0? There're quite a lot of things to tackle, so I'd be interested when you hope to push out the next MkDocs release |
Addendum: if 1.6.0 is too far into the future, it might be a good idea to cut the 1.6.0 release into smaller releases. |
Merging #3391 is feasible. It's in 1.6.0 milestone and will definitely make it in. Other things that are in that milestone will likely be pushed back, yes. Yes please open pull requests for issues. They don't have to be held back by other things in the milestone, it's flexible. That said, I'll be on vacation still for over a week and I don't see urgency in this anyway |
Whenever we use
mkdocs serve --livereload
, the livereload server blocks, as MkDocs waits for changes to files that can be reported back to the browser. This technique is known as long polling, and albeit we now have wide support for websockets which are a superior solution, it's a perfectly fine implementation for livereload functionality.Blocking is implemented here:
mkdocs/mkdocs/livereload/__init__.py
Line 262 in 347c3a9
However, sometimes when I navigate the site while working on it, MkDocs gets stuck in this condition and waits for changes to files. There are three ways to unblock it:
/livereload
requestI'm not very familiar with the livereload implementation, but the problem seems to be that the server is occupied with waiting for the livereload request to finish hitting one of the conditions mentioned above, which prohibits the navigation from happening – see the loading indicator after navigating for the third time:
Ohne.Titel.mov
My testing shows that this problem can be solved by cancelling the pending
/livereload
request before navigation.The text was updated successfully, but these errors were encountered: