Skip to content

Example either crash or hangs on Windows #22

@qonn

Description

@qonn

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:

jennet/jennet/jennet.pony

Lines 172 to 186 in 6ed62c9

primitive StatusResponse
fun apply(
status: Status,
headers: Array[(String, String)] box = [],
close: Bool = true)
: BuildableResponse iso^
=>
let res = recover BuildableResponse(status) end
for (k, v) in headers.values() do
res.add_header(k, v)
end
if close and (res.header("Connection") is None) then
res.add_header("Connection", "close")
end
res

Mine:
image

Steps to Reproduce

  1. Windows Machine?
  2. Ubuntu WSL installed
  3. wrk installed following
  4. Pretty much everything else was just copy pasted from get started with pony mixed with trying to get jennet to run. But i'm going to write the steps anyway starting from step 3 😄
  5. Install Pony https://github.com/ponylang/ponyc/blob/main/INSTALL.md#windows
  6. Install corral https://github.com/ponylang/corral/blob/main/BUILD.md#from-source-windows
  7. Create a new folder? jennet-test
  8. corral init
  9. Install corral dependencies
  10. jennet doesn't use main as the main branch so corral will fail. Thus we have to manually clone the jennet git into _corral folder in the jennet_test/_corral/github_com_theodus_jennet
  11. follow https://github.com/Theodus/jennet#named-parameters example (I do need to change the listening host to 0.0.0.0)
  12. run with command in cmd corral run -- ponyc --define openssl_0.9.0
  13. run wrk with WSL wrk -c100 -d30s --latency http://127.0.0.1:8080/

Context (Environment)

  • Windows 10
  • Ubuntu WSL
  • ponyc
    0.41.1 [release]
    Compiled with: LLVM 9.0.1 -- MSVC-19.28.29335.0-x64 1928
  • OpenSSL 0.9.0

Notes:

It works fine when building & running in a linux environment, just 100x much more slower somehow (might be due to WSL?):

  • Ubuntu 18.04.2 LTS (WSL)
  • ponyc
    0.41.1-4553e6cf [release]
    Compiled with: LLVM 9.0.1 -- Clang-6.0.0-x86_64
    Defaults: pic=true
  • OpenSSL 1.1.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions