eclipse-uprotocol / eclipse-uprotocol/up-cpp
Remove pending requests from the RpcClient's expiration queue when responses are received
- Dominant language
- C++
- Stars
- 29
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Description
> I think what I'm going to have to do to address this issue is
>
> 1. Add the request ID to the `PendingRequest` struct
> 2. Add a second `scrub()` method to `ScrubablePendingQueue` that takes a UUID to scrub a single request
> 3. Add a second `scrub()` method to `ExpireWorker` that takes a UUID and puts it in a scrub queue for deferred scrubbing (and then wakes the worker thread)
> 4. Modify the callback wrapper such that it calls that `scrub()` method on the `ExpireService` for the request ID inside of the `call_once` section 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 to `RpcClient` (along with the supporting methods in the expiration service infrastructure). Then the test could inherit from RpcClient and use that `pending()` 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_
Contributor guide
Assessment
This issue has not been assessed yet.