From dc98a06060e0512c6712748b53f9825d7cbd4561 Mon Sep 17 00:00:00 2001 From: vahid torkaman Date: Fri, 10 Oct 2025 16:41:22 +0200 Subject: [PATCH] bump wasm --- openfeature-provider-local/pom.xml | 2 +- .../src/main/java/com/spotify/confidence/WasmResolveApi.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/openfeature-provider-local/pom.xml b/openfeature-provider-local/pom.xml index f8065a67..e18e4f6d 100644 --- a/openfeature-provider-local/pom.xml +++ b/openfeature-provider-local/pom.xml @@ -19,7 +19,7 @@ 17 17 - v0.4.0 + v0.5.0 diff --git a/openfeature-provider-local/src/main/java/com/spotify/confidence/WasmResolveApi.java b/openfeature-provider-local/src/main/java/com/spotify/confidence/WasmResolveApi.java index 29686bac..0e20a3b0 100644 --- a/openfeature-provider-local/src/main/java/com/spotify/confidence/WasmResolveApi.java +++ b/openfeature-provider-local/src/main/java/com/spotify/confidence/WasmResolveApi.java @@ -40,6 +40,7 @@ class WasmResolveApi { private final FunctionType HOST_FN_TYPE = FunctionType.of(List.of(ValType.I32), List.of(ValType.I32)); private final Instance instance; + private boolean isConsumed = false; // interop private final ExportFunction wasmMsgAlloc; @@ -127,6 +128,7 @@ public void close() { final var respPtr = (int) wasmMsgFlushLogs.apply(reqPtr)[0]; final var request = consumeResponse(respPtr, WriteFlagLogsRequest::parseFrom); writeFlagLogs.write(request); + isConsumed = true; } finally { wasmLock.readLock().unlock(); } @@ -134,7 +136,7 @@ public void close() { public ResolveWithStickyResponse resolveWithSticky(ResolveWithStickyRequest request) throws IsClosedException { - if (!wasmLock.writeLock().tryLock()) { + if (!wasmLock.writeLock().tryLock() || isConsumed) { throw new IsClosedException(); } try {