In many places we use imessaging_init() or imessaging_client_init() to create a temporary struct imessaging_context and in most places we use a temporary tevent_context. In that case any message the process receives gets queued up on the temporary tevent contexts, see imessaging_dgm_recv() and imessaging_post_self(). As these temporary tevent contexts never run tevent_loop_once(), they'll never reach imessaging_post_handler() and the struct imessaging_post_state and struct tevent_immediate per message stay forever.
This bug was referenced in samba master: a120fb1c724dfaed5a99e34aaf979502586f17c0 32df5e4961cf064b72bb496157cc6092126d9b8e 266bcedc18efc52e29efde6bad220623a5423e30
Created attachment 17568 [details] Patches for v4-17-test
Created attachment 17569 [details] Patches for v4-16-test (require patches from bug #15159)
Comment on attachment 17568 [details] Patches for v4-17-test This attachment is for bug #15200 not #15201
Comment on attachment 17569 [details] Patches for v4-16-test (require patches from bug #15159) This attachment is for bug #15200 not #15201
Created attachment 17570 [details] Patches for v4-17-test
Created attachment 17571 [details] Patches for v4-16-test
Reassigning to Jule for inclusion in 4.16 and 4.17.
Pushed to autobuild-v4-{17,16}-test.
This bug was referenced in samba v4-16-test: 6ba44033e3869196982e67a8f757f34a5e1f2788 04d0d5a0366ec92a7cafcf56e0cf2c74780c0eed c28d971b12bab1342d9ad0a8475deef647e5aa1b
This bug was referenced in samba v4-17-test: 68a0ef3b5215f37c74e7831db36a0b360ee661ca 28c65ce3e923deaa273e4dabd7c6228c803b03c7 7540755de6a0fcc8b9b34fdcca777c77b8de9402
Closing out bug report. Thanks!
This bug was referenced in samba v4-17-stable (Release samba-4.17.1): 68a0ef3b5215f37c74e7831db36a0b360ee661ca 28c65ce3e923deaa273e4dabd7c6228c803b03c7 7540755de6a0fcc8b9b34fdcca777c77b8de9402
This bug was referenced in samba v4-16-stable (Release samba-4.16.8): 6ba44033e3869196982e67a8f757f34a5e1f2788 04d0d5a0366ec92a7cafcf56e0cf2c74780c0eed c28d971b12bab1342d9ad0a8475deef647e5aa1b