• Kenton Varda's avatar
    Fix two subtle bugs with embargos, and improve docs. · 1cdcc24b
    Kenton Varda authored
    Bug 1
    -----
    
    If a Resolve message indicated that the promise had been rejected, the code would see the error cap as a local cap and erroneously believe that the promise had resolved back to a local capability, thereby requiring a Disembargo to be sent. The peer, on receiving the nonsensical Disembargo, would throw an exception and close the connection.
    
    The error message seen was: "expected target->getBrand() == this; 'Disembargo' of type 'senderLoopback' sent to an object that does not point back to the sender."
    
    Bug 2
    -----
    
    Disembargos are sent not only in response to Resolves, but also Returns, since capabilities in a returned message were previously accessible as PromisedAnswers. This means that we must apply the same rule that states that once a promise has been resolved, the promise must from then on forward all messages it receives strictly to the object to which it resolved, even if that object is itself a promise which later resolves to somewhere else. The code which sends Resolve messages was doing this correctly, but the code sending Return messages was not. They now both operate correctly. I've also added more explanation to the documentation in rpc.capnp.
    
    The error message seen was: "expected redirect == nullptr; 'Disembargo' of type 'senderLoopback' sent to an object that does not appear to have been the object of a previous 'Resolve' message."
    1cdcc24b
Name
Last commit
Last update
c++ Loading commit data...
doc Loading commit data...
highlighting/qtcreator Loading commit data...
.gitignore Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
RELEASE-PROCESS.md Loading commit data...
mega-test-quick.cfg Loading commit data...
mega-test.cfg Loading commit data...
mega-test.py Loading commit data...
release.sh Loading commit data...
super-test.sh Loading commit data...