Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
libflux/rpc: add FLUX_RPC_STREAMING and FLUX_O_MATCHDEBUG #1942
This PR adds a
In addition, some stderr debugging is added to rpc and mrpc for leaky matchtags if the
@@ Coverage Diff @@ ## master #1942 +/- ## ========================================== + Coverage 80.07% 80.07% +<.01% ========================================== Files 195 195 Lines 35078 35110 +32 ========================================== + Hits 28088 28114 +26 - Misses 6990 6996 +6
If a matchtag is leaked, and the user set the FLUX_O_MATCHDEBUG flag, log the event to stderr.
Problem: If an MRPC is destroyed before all responses are received, the matchtag is leaked to prevent it from being reused in a new request. This may be normal or due to a programming error. If flux_t handle has the FLUX_O_MATCHDEBUG flag, log this to stderr.
Problem: although logic exists to leak a matchtag if an RPC future is destroyed without being fulfilled, this is insufficient for streaming RPCs, which may still have responses in flight even when the future is fulfilled. Add a FLUX_RPC_STREAMING flag to designate an RPC as expecting multiple responses, then leak the matchtag if it has not been fulfilled with an error, which signifies end-of-stream per RFC 6.
Add the FLUX_RPC_STREAMING flag to the KVS lookup RPC, if the FLUX_KVS_WATCH flag is set. This will enable matchtag reuse safety and FLUX_O_DEBUG for code that improperly destroys the lookup future with lookup responses potentially in flight.
Problem: passing topic string to rpc function in a variable is a vetige of previous code that allowed get root "watching". Pass the topic string directly into the RPC function as we do most other places.