mirror of
https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git
synced 2025-03-12 14:51:41 +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));
|
||||
|
||||
// Not part of original test. "Terminate" sequence with
|
||||
|
@ -1453,16 +1453,12 @@ namespace Capnp.Rpc
|
||||
|
||||
void IRpcEndpoint.RemoveImport(uint importId)
|
||||
{
|
||||
bool exists;
|
||||
|
||||
lock (_reentrancyBlocker)
|
||||
{
|
||||
exists = _importTable.Remove(importId);
|
||||
}
|
||||
|
||||
if (!exists)
|
||||
{
|
||||
Logger.LogError("Inconsistent import table detected");
|
||||
if (!_importTable.Remove(importId))
|
||||
{
|
||||
throw new ArgumentException("Given ID does not exist in import table");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user