You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
interface_http.py fails in assert_equal(response2.status, http.client.BAD_REQUEST) AssertionError: not(413 == 400) #35082
test 2026-04-15T06:46:03.124196Z TestFramework (INFO): Check excessive size HTTP request encoded with chunked transfer
test 2026-04-15T06:46:03.198837Z TestFramework (ERROR): Unexpected exception:
Traceback (most recent call last):
File "/__w/bitcoin-core-nightly/bitcoin-core-nightly/test/functional/test_framework/test_framework.py", line 143, in main
self.run_test()
File "/__w/bitcoin-core-nightly/bitcoin-core-nightly/bld/test/functional/interface_http.py", line 109, in run_test
self.check_chunked_transfer()
File "/__w/bitcoin-core-nightly/bitcoin-core-nightly/bld/test/functional/interface_http.py", line 312, in check_chunked_transfer
assert_equal(response2.status, http.client.BAD_REQUEST)
File "/__w/bitcoin-core-nightly/bitcoin-core-nightly/test/functional/test_framework/util.py", line 83, in assert_equal
raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
AssertionError: not(413 == 400)
I tried this in a fresh ubuntu:noble container locally, but it passed:
Line 1022: buflen > EV_SSIZE_MAX fires before the chunk size is even parsed — if client sends chunk header + large data together, this fires. If they arrive in separate TCP segments, the max_body_size check at line 1065 fires instead. This is the race condition causing "sometimes 413, more often 400".
Ok I got too excited, the problem is not as cool as claude thinks. There is still a race condition already described by a comment in the test, I just never correctly observed one path of the race. 413 is the expected error code and I can reproduce it, will update this test with a follow-up PR.
Activity
pinheadmz commentedon Apr 15, 2026
looking in to this today. 413 is content too large which makes sense, maybe a race in libevent between that and generic 400 bad request
pinheadmz commentedon Apr 15, 2026
OMG Claude is fucking amazing:
https://github.com/libevent/libevent/blob/48296514d8fd9c0b3812b11d45ad80b0c002c14e/http.c#L1025-L1027
pinheadmz commentedon Apr 15, 2026
Ok I got too excited, the problem is not as cool as claude thinks. There is still a race condition already described by a comment in the test, I just never correctly observed one path of the race. 413 is the expected error code and I can reproduce it, will update this test with a follow-up PR.
Merge bitcoin#35086: test: interface_http follow-ups