-
Notifications
You must be signed in to change notification settings - Fork 87
website-serve infinite loop #441
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
Comments
Sorry, I can't seem to reproduce this easily; this is from a fresh clone of the current main branch:
|
Here is a complete testproject that shows the problem - on linux, that is, I don't know if it happens on other OS. |
I dug a bit deeper: The server hangs at the lambdanative/modules/website/website.scm Line 129 in b9f302a
Wireshark says:
Don't know what to do about it. |
Your test project example runs fine when built against libgambit, but I can also make it fail on Gentoo with libgambc. Interestingly, if I comment the line with If I try apps/DemoHybridApp/main.scm and don't give focus to the small loader window, it also doesn't do anything; yet when I give it focus, it renders the website. Applying the same idea to your app, it doesn't render the website, but once I click the black box in the 'DemoWebTemplate' app window the website renders. I can't quite point to where exactly this happens but it is lack of redraw events coming from OpenGL and is a known problem (see #86 (comment)). |
Found it! loaders/x11/x11_microgl.c line 253 says: lambdanative/loaders/x11/x11_microgl.c Line 253 in b9f302a
Now this removes all Bugfix: Replace the line with this:
... as an afterthought: if the application is only a webserver without GUI, wouldn't it be nice to remove the opengl window? Maybe a target called |
The loaders/x11/x11_microgl.c#L253 code used to be that way since inception until b0a16b3, and I can't recall why we changed it specifically? - Added: It was part of pull request #417 which we partially implemented; I'd be happy to revert that change but I didn't author the original change. Nothing requires you to use a web server with a GUI (my earliest example was a ConsoleApp). - It is solely that you used modules/hybridapp/hybridapp.scm#L68 which has the GUI requirement so people can use it to test applications that run in a mobile device - if you look at modules/hybridapp/MODULES it either applies an |
The patch is flaged as "avoid some of the needless redraw events" - that might have been true in earlier days, but while they might end in eventloop.scm but do nothing. A redraw is explictly done when EVENT_REDRAW is sent down the line, so no problem there. @hybridapp: Yes, I missed that part. I was unter the impression that hybridapp works the same on X11 as on iOS/Android - till I realised that the browser part is totally independent from the scheme part. |
Before I undo b0a16b3 could you test and confirm that this fixes your problem completely; I recall from earlier data collection applications we had built that processing stops after a few seconds when the focus is not on the app - this is a Linux-specific problem, as Windows has a timer that triggers it at least every second (fdc3626), and similar heartbeat things exist on iOS and Android. |
At least on my system it works, even when the dummy window is never exposed (= it's hidden behind forground windows all the time) and never get the focus. I don't think the timer is needed on linux - at least on Xorg, things might be different on Wayland. I could add a timer if you find that processing stops after some seconds - alarm(1) will most likely do. |
Uh oh!
There was an error while loading. Please reload this page.
I just realized that the "website" module does not work any more on linux. Minimal example:
(website-serve #f 8080)
The code does nothing but to start the local server. It should do nothing but to recat to http requests. But it results in one process occupying one core 100%. That process does not generate any output not does it response to any request.
The text was updated successfully, but these errors were encountered: