> I'm attaching the updated patches, which primarily include cleanup and > have been rebased > following the CFbot report.
Thanks for updating the patch!
I observed an assertion failure when forcing a timeout as follows:
Good catch. This assertion is no longer valid because of recent updates that reset the client_keys slot for a request when the client exits with a timeout. To address this, I’ve replaced the assertion with a check for -1 and now return
from the function in that case.
It might be good to also document in func-admin.sgml that the function times out after 5 seconds when the target backend does not respond, and that in such a case NULLs are returned.
Added this.
From the comment, it sounded to me as if the client executing pg_get_process_memory_contexts() might not create the DSA in some cases. Is it correct to assume that such a situation can happen? In [1], as a response to concerns about using DSA inside a CFI handler, you wrote that “all the dynamic shared memory needed to store the statistics is created and deleted in the client function”. So I understood that it would never create the DSA inside the CFI handler. If that understanding is correct, perhaps the comment should be reworded to make that clear.
Yes, your understanding is correct. I reworded the comment accordingly.