mirror of
https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git
synced 2025-03-13 23:31:50 +01:00
RpcEngine.RemoveImport should throw rather than just log a warning when import ID is wrong
This commit is contained in:
parent
c8881f3482
commit
7ea1c5dd1d
@ -345,7 +345,7 @@ namespace Capnp.Net.Runtime.Tests
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that all answers either return (probably in canceled state)
|
// Ensure that all answers return (probably in canceled state)
|
||||||
Assert.IsTrue(Task.WhenAll(taskList).Wait(LargeNonDbgTimeout));
|
Assert.IsTrue(Task.WhenAll(taskList).Wait(LargeNonDbgTimeout));
|
||||||
|
|
||||||
// Not part of original test. "Terminate" sequence with
|
// Not part of original test. "Terminate" sequence with
|
||||||
|
@ -1453,16 +1453,12 @@ namespace Capnp.Rpc
|
|||||||
|
|
||||||
void IRpcEndpoint.RemoveImport(uint importId)
|
void IRpcEndpoint.RemoveImport(uint importId)
|
||||||
{
|
{
|
||||||
bool exists;
|
|
||||||
|
|
||||||
lock (_reentrancyBlocker)
|
lock (_reentrancyBlocker)
|
||||||
{
|
{
|
||||||
exists = _importTable.Remove(importId);
|
if (!_importTable.Remove(importId))
|
||||||
}
|
{
|
||||||
|
throw new ArgumentException("Given ID does not exist in import table");
|
||||||
if (!exists)
|
}
|
||||||
{
|
|
||||||
Logger.LogError("Inconsistent import table detected");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user