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

Service request and forks #137

Open
joxoby opened this issue May 15, 2020 · 0 comments
Open

Service request and forks #137

joxoby opened this issue May 15, 2020 · 0 comments
Assignees

Comments

@joxoby
Copy link
Contributor

joxoby commented May 15, 2020

There seems to be a problem when dealing with service request and forks:

Steps to reproduce

Expected output

Load transport shared library BEFORE forking
Service executed: true
Service result: true
Service reply: true

Actual output

Load transport shared library BEFORE forking
Service executed: false
Service result: false
Service reply: false

Comments

If I run the executable test_service_request --random_arg to make it load the transport library after the fork, the output is:

Load transport shared library AFTER forking
Service executed: true
Service result: true
Service reply: true

The difference between both cases is that when loading the library before forking, the parent and the child share the same shared library in memory, which will make both processes share the same NodeShared singleton, and in turn, share use the same ZMQ context.

Possible solution

Create a NodeShared instance per process

joxoby pushed a commit to joxoby/ign-transport that referenced this issue May 15, 2020
joxoby pushed a commit to joxoby/ign-transport that referenced this issue May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants