Skip to content
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

Test http_server fails on FreeBSD #1500

Open
UncleGrumpy opened this issue Jan 27, 2025 · 1 comment
Open

Test http_server fails on FreeBSD #1500

UncleGrumpy opened this issue Jan 27, 2025 · 1 comment

Comments

@UncleGrumpy
Copy link
Collaborator

In recent build-and-test-on-FreeBSD workflows (after the last update to the workflow) the test http_server fails because the client does not receive the body of the message before the server closes the socket. @pguyot helped me track down the problem in our discussions in the Telegram chat, and suggested, as a temporary fix until the server can be rewritten, that a delay was needed before closing the socket so the client could have time to receive the body of the message.

Here was his Telegram comment on the situation:

It looks like a bug in http_server. On this FreeBSD run, the client doesn’t get the body. It seems a bug to me, the server shouldn’t close so fast the connection, as RFC reads “SHOULD issue a graceful close”. We don’t see it on Linux or macOS because the whole packet is flushed. I’m not sure that with gen_tcp we can shutdown the socket, which I think is what most httpd implementation do as graceful, combined with timeout full close.

I think 5 seconds seemed a bit long to hold the socket open, but I don't know how short we can make that and still be sure the client receives the entire body before the socket is closed during times of heavy network congestion. I think waiting 500 to 1000 ms would be sufficient.

I don't understand the subtle differences of the FreeBSD network stack to know why the entire packet is not flushed as on Linux and MacOS, and would welcome any other suggestion or fix.

@petermm
Copy link
Contributor

petermm commented Feb 2, 2025

bettio added a commit to bettio/AtomVM-fork that referenced this issue Feb 10, 2025
Right now complete FreeBSD workflow fail, so instead just skip the whole
`test_eavmlib.avm` in order to skip http test.

TODO: enable it again as soon as atomvm#1500 is fixed.

Signed-off-by: Davide Bettio <[email protected]>
bettio added a commit to bettio/AtomVM-fork that referenced this issue Feb 11, 2025
Right now the complete FreeBSD workflow fail, so instead just skip http
test in order to run (at least) all the other tests.

TODO: enable it again as soon as atomvm#1500 is fixed.

Signed-off-by: Davide Bettio <[email protected]>
bettio added a commit to bettio/AtomVM-fork that referenced this issue Feb 11, 2025
Right now the complete FreeBSD workflow fail, so instead just skip http
test in order to run (at least) all the other tests.

TODO: enable it again as soon as atomvm#1500 is fixed.

Signed-off-by: Davide Bettio <[email protected]>
bettio added a commit that referenced this issue Feb 11, 2025
CI: reduce the scope of FreeBSD CI tests

Right now complete FreeBSD workflow fail, so exclude `test_http_server` so we can
run the rest of the tests on FreeBSD.
Let's readd http_test as soon as #1500 is fixed.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants