Open qonn opened 3 years ago
Hi @qonn! Thanks for bringing up these issues. Apparently the CI has fallen out of sync with Pony releases, which I'm going to fix now. I've just switched the primary branch to "main" instead of "master", and updated the dependencies to support the latest release version of the compiler. You should now be able to run the tests by just cloning the repo and running make test
. Let me know if you are still experiencing the same issues on Windows.
Hi @Theodus, no problem! Thanks for the fix, it is easier to get things running now. unfortunately, I did another fresh initialization of jennet, the same example (corral add & corral fetch now works fine). Retest using wrk -c512 -d30s --latency http://127.0.0.1:9999/
. 1st run -> crash, 2nd run -> hangs again. 3rd run -> crash and so on...
Also, running make test
doesn't really work properly on Windows at least for me. I managed to build the test.exe
manually but that's about it, I run the test.exe
but no output. just the emptiness of the terminal heheh.
I don't use Windows, but I suspect a reasonable fix would be to replace Context.respond
with the following:
fun ref respond(res: BuildableResponse iso, res_body: ValBytes = []) =>
"""
Respond to the given request with the response.
"""
if res_body.size() > 0 then
res.add_header("Content-Length", res_body.size().string())
end
_responder(consume res, ByteArrays(res_body), this)
Feel free to open a PR if this fix works for you, or if you have an alternative suggestion. Also, if you have had a Pony program crash (like a segfault). it would be good to have some more detail about that because that may be a bug somewhere in the Pony libraries we depend on.
When I run the main example on Windows, it's either crash (2%) or just hang after several concurrent requests (98%).
Expected Behavior
Pony should never crash or hang once compiled! At least based on jennet implementation, it doesn't really do that much.
Current Behavior
Everything compiled nicely, but once I run the wrk tool via Ubuntu WSL
wrk -c100 -d30s --latency http://127.0.0.1:8080/
. It will crash or just hang forever instantly within 2 seconds. No errors, nothing. Just a feeling of emptiness.Current Workaround
I managed to get this working by always adding a
Content-Length
header to the BuildableResponse, I pretty much use my own BuildableResponse, instead of using the one provided here:Original: https://github.com/Theodus/jennet/blob/6ed62c9d119879d6fdf571f85feab77bdc28bdd5/jennet/jennet.pony#L172-L186
Mine:
Steps to Reproduce
jennet-test
corral init
corral add github.com/ponylang/http_server.git
main
as the main branch so corral will fail. Thus we have to manually clone the jennet git into _corral folder in thejennet_test/_corral/github_com_theodus_jennet
corral run -- ponyc --define openssl_0.9.0
wrk -c100 -d30s --latency http://127.0.0.1:8080/
Context (Environment)
Notes:
It works fine when building & running in a linux environment, just 100x much more slower somehow (might be due to WSL?):