Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deregistering in RPC handler #619

Open
mdorier opened this issue Aug 31, 2022 · 2 comments
Open

Deregistering in RPC handler #619

mdorier opened this issue Aug 31, 2022 · 2 comments

Comments

@mdorier
Copy link

mdorier commented Aug 31, 2022

If an RPC handler calls HG_Deregister to deregister itself, a subsequent HG_Respond will cause a segfault, with the following backtrace:

#0  hg_set_struct (hg_handle=hg_handle@entry=0x55fe46cef810, hg_proc_info=0x594925d9ff758133, op=op@entry=HG_OUTPUT,
    struct_ptr=struct_ptr@entry=0x7f94fce16ef0, payload_size=payload_size@entry=0x7f94fce16ec0, more_data=more_data@entry=0x7f94fce16ebf "")
    at /tmp/mdorier/spack-stage/spack-stage-mercury-2.2.0-ftf2olh6pdj2dt2vn4fhcxifrucwuuba/spack-src/src/mercury.c:577
#1  0x00007f94fe9e2287 in HG_Respond (handle=handle@entry=0x55fe46cef810, callback=callback@entry=0x7f94fea3e600 <margo_cb>,
    arg=arg@entry=0x7f94fce16f50, out_struct=out_struct@entry=0x7f94fce16ef0)
    at /tmp/mdorier/spack-stage/spack-stage-mercury-2.2.0-ftf2olh6pdj2dt2vn4fhcxifrucwuuba/spack-src/src/mercury.c:2044

Ideally, an error in HG_Respond should be returned.

I haven't checked if other functions (like HG_Get_input/output) succeed, fail, or crash, but maybe it would be good to ensure a well-defined behavior of functions that use a handle associated with an RPC that has been deregistered.

@soumagne
Copy link
Member

soumagne commented Jun 6, 2023

Handles cache RPC info on server to prevent extra lookups from RPC ID hash table, we'll need to either refcount entries in hash table or ensure that we cannot deregister an RPC until all RPCs under that ID have been executed.

@soumagne soumagne modified the milestones: mercury-2.3.0, future Jun 6, 2023
@soumagne
Copy link
Member

soumagne commented Jun 6, 2023

Linked to #534

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants