fix "questionId is already in use" error

This commit is contained in:
Alessandro Arcangeli 2021-10-16 13:30:47 +02:00 committed by GitHub
parent eab88298e2
commit 2731586bb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -758,10 +758,12 @@ final class RpcState<VatId> {
if (ctx != null) {
ctx.requestCancel();
}
else {
var questionId = finish.getQuestionId();
answers.erase(questionId);
}
// Remove question id
// this is a different then c++ implementation, but it is required as java's promises doesn't support
// all features of kj's promises
var questionId = finish.getQuestionId();
answers.erase(questionId);
if (exportsToRelease != null) {
this.releaseExports(exportsToRelease);