File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
openfeature-provider-local
src/main/java/com/spotify/confidence Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments