tests: pin pooled-dispatch concurrency; sqlite pins follow THREADSAFE=1

server_http gains the case that caught the live crash: 1000 keep-alive
requests at c=10 against /api/apps (full SQLite load per request, on
the 4-worker pool) must complete with 0 failures and leave the server
answering. sqlite_api's threadsafe pins flip to guard the NEW invariant
— a regression to THREADSAFE=0 reintroduces heap corruption under the
pool (free-of-unallocated inside yy_reduce, caught under ab -c20).
This commit is contained in:
agra
2026-06-12 22:46:12 +03:00
parent 74b41f5c83
commit c734f47952
2 changed files with 17 additions and 4 deletions

View File

@@ -2,8 +2,9 @@
// every wrapper family beyond the P5.1 smoke (which keeps owning the
// vendored-version pin):
//
// * library: version_number, sourceid, threadsafe=false (built
// THREADSAFE=0), compileoption_used, complete, errstr, strglob/
// * library: version_number, sourceid, threadsafe=true (built
// THREADSAFE=1 since std.thread pools share the library),
// compileoption_used, complete, errstr, strglob/
// strlike/stricmp, randomness.
// * connections: open_v2 flag behavior (READONLY on a missing file
// refuses; CREATE works; db_readonly reflects the mode),
@@ -37,8 +38,8 @@ run_case :: (label: string, ok: bool) -> i32 {
check_library_info :: () -> bool {
if sq.sqlite_version_number() < 3053000 { return false; }
if sq.sqlite_sourceid().len < 10 { return false; }
if sq.sqlite_threadsafe() { return false; } // THREADSAFE=0 build
if !sq.sqlite_compileoption_used("THREADSAFE=0") { return false; }
if !sq.sqlite_threadsafe() { return false; } // THREADSAFE=1: std.thread-era pools share the library (PLAN-HTTPZ A2)
if !sq.sqlite_compileoption_used("THREADSAFE=1") { return false; }
if sq.sqlite_compileoption_get(0).len == 0 { return false; }
return true;
}