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

Ability to set GZ_DISCOVERY_* variables from the Python API #531

Open
AmalDevHaridevan opened this issue Sep 7, 2024 · 1 comment
Open
Assignees
Labels
enhancement New feature or request

Comments

@AmalDevHaridevan
Copy link

Desired behaviour

Currently, for a single process, python interpreter doesn’t perform dlclose after opening any cython library until the process terminates. This produces issues when the variables have global visibility, which is the default for pybind. We can set visibility for these variables within only the objects scope by passing appropriate flags in the pybind module.

My specific problem has to do with the Node creation. I want to instantiate multiple Nodes in isolated network in a single process. Currently due to the mentioned problem, this is impossible because the Node will stay with the env vars found at first import. We cannot delete references to the module from sys.modules and obtain desired behaviour.

I would like to work on this as well, to contribute to the project.

Alternatives considered

Implementation suggestion

Additional context

Multiple isolated Nodes in a single Python process.

@AmalDevHaridevan AmalDevHaridevan added the enhancement New feature or request label Sep 7, 2024
@azeey azeey moved this from Inbox to To do in Core development Nov 11, 2024
@caguero
Copy link
Collaborator

caguero commented Nov 11, 2024

Both GZ_DISCOVERY_ and GZ_PARTITION settings work at the process level. They let you isolate all nodes within the process_1 from the set of nodes within process_2. Currently, this is the smaller granularity that gz-transport has. If you're looking to isolate node_1 from node_2, where both nodes share the same process, I don't think there's that option right now unless we add support for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: To do
Development

Successfully merging a pull request may close this issue.

2 participants