raceconditions
I ran into
thread 546199 panic: switch on corrupt value
Unwind error at address `:0x10c36e3` (error.AddressOutOfRange), trace may be incomplete
/home/adrian/.cache/zig/p/httpz-0.0.0-PNVzrGu3BgAIRvYiWsbvVbzUyZg1-rzoT71hVSeLCHz7/src/worker.zig:564:49: 0x125efa3 in run (httpz.zig)
.recv => |conn| switch (conn.protocol) {
^
/home/adrian/projects/tar/zig-linux/lib/std/Thread.zig:488:13: 0x1236ab8 in callFn__anon_33979 (std.zig)
@call(.auto, f, args);
^
/home/adrian/projects/tar/zig-linux/lib/std/Thread.zig:757:30: 0x12127cd in entryFn (std.zig)
return callFn(f, args_ptr.*);
^
aborting due to recursive panic
while creating 100 connections to a slow endpoint (1.65s avg. lat.)
with for x in {0..100}; do curl http://localhost:1024/api/1 --output /dev/null & done
After that i compiled with threadsan and came across a lot of raceconditions. I think most of theese should be fixed asap as they seem to be causing real problems.
https://pastebin.com/SbDL8Z1a
I can replicate getting a bunch of tsan errors with zig build test -Dtsan, I'm willing to take a look to try to resolve (some of?) these.
See #140 for some small changes that address the ThreadSanitizer-discovered races.
Note: the above report is for an old version. I suggest the issue remain open until the underlying issue is fixed.