Remove pending requests from the RpcClient's expiration queue when responses are received
I think what I'm going to have to do to address this issue is
- Add the request ID to the
PendingRequeststruct- Add a second
scrub()method toScrubablePendingQueuethat takes a UUID to scrub a single request- Add a second
scrub()method toExpireWorkerthat takes a UUID and puts it in a scrub queue for deferred scrubbing (and then wakes the worker thread)- Modify the callback wrapper such that it calls that
scrub()method on theExpireServicefor the request ID inside of thecall_oncesection and after the message has been passed to the caller.Testing this is also going to be somewhat challenging. There isn't a direct way to observe if the request is still in the pending queue. I think I would need to add a protected
bool pending(v1::Uuid)method toRpcClient(along with the supporting methods in the expiration service infrastructure). Then the test could inherit from RpcClient and use thatpending()method to check.I'm a little nervous about the scope of that change and the possible interactions this close to a release. @billpittman - how bad do you think this issue is, and could we possibly take it as an improvement in alpha.3?
Originally posted by @gregmedd in https://github.com/eclipse-uprotocol/up-cpp/pull/202#discussion_r1674896431