Skip to content

Commit 12d5378

Browse files
authored
chore: bump wasm (#304)
bump wasm
1 parent 0071949 commit 12d5378

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

openfeature-provider-local/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<maven.compiler.source>17</maven.compiler.source>
2020
<maven.compiler.target>17</maven.compiler.target>
2121
<!-- WASM file version. When updated, make sure to mvn clean to force a new download -->
22-
<confidence.resolver.wasm.version>v0.4.0</confidence.resolver.wasm.version>
22+
<confidence.resolver.wasm.version>v0.5.0</confidence.resolver.wasm.version>
2323
</properties>
2424

2525

openfeature-provider-local/src/main/java/com/spotify/confidence/WasmResolveApi.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class WasmResolveApi {
4040
private final FunctionType HOST_FN_TYPE =
4141
FunctionType.of(List.of(ValType.I32), List.of(ValType.I32));
4242
private final Instance instance;
43+
private boolean isConsumed = false;
4344

4445
// interop
4546
private final ExportFunction wasmMsgAlloc;
@@ -127,14 +128,15 @@ public void close() {
127128
final var respPtr = (int) wasmMsgFlushLogs.apply(reqPtr)[0];
128129
final var request = consumeResponse(respPtr, WriteFlagLogsRequest::parseFrom);
129130
writeFlagLogs.write(request);
131+
isConsumed = true;
130132
} finally {
131133
wasmLock.readLock().unlock();
132134
}
133135
}
134136

135137
public ResolveWithStickyResponse resolveWithSticky(ResolveWithStickyRequest request)
136138
throws IsClosedException {
137-
if (!wasmLock.writeLock().tryLock()) {
139+
if (!wasmLock.writeLock().tryLock() || isConsumed) {
138140
throw new IsClosedException();
139141
}
140142
try {

0 commit comments

Comments
 (0)