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

Add option to use global ZMQ context #820

Merged

Conversation

kevin-bates
Copy link
Member

We have found that reverting the context in jupyter_client to its global form (from a year ago) doesn't lead to FD leaks. The change away from the global context fixed an issue with multi-threaded kernel client applications, which EG probably doesn't need.

This change adds a configurable option (use_global_zmq_context=True) to enable the use of a global (singleton) context. By default, the current behavior in jupter_client is used.

The reason this is configurable is that jupyter_client may soon release a change that would cause things to break if a global context was in use and we'd need to have a means of using jupyter_client's context directly - which a 'False' value permits.

To enable the use of the global ZMQ context, either of the following options must be taken...

Add to the config file or command line:
--RemoteKernelManager.use_global_zmq_context=True

or set the environment variable...
EG_USE_GLOBAL_ZMQ_CONTEXT=True

Upon use of the first ZMQ port (for each kernel), you should see the following informational message logged:

[I 2020-06-05 15:51:44.324 EnterpriseGatewayApp] Using global ZMQ context via configuration override (use_global_zmq_context=True).

We have found that reverting the context in jupyter_client to its
global form (from a year ago) doesn't lead to FD leaks.  The change
away from the global context fixed an issue with multi-threaded
kernel client applications, which EG probably doesn't need.

This change adds a configurable option (use_global_zmq_context=True)
to enable use of a global (singleton) context.  By default, the
current behavior in jupter_client is used.
Copy link
Member

@lresende lresende left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lresende lresende merged commit f63148e into jupyter-server:master Jun 8, 2020
@kevin-bates kevin-bates deleted the optional-global-zmq-context branch June 9, 2020 23:51
kevin-bates added a commit to kevin-bates/enterprise_gateway that referenced this pull request Jun 30, 2020
This is now default behavior in jupyter_client versions 5.3.5 and
6.1.5 and makes the previous change obsolete. This rolls back jupyter-server#820.
@kevin-bates kevin-bates removed this from the v1.x milestone Jun 30, 2020
lresende pushed a commit that referenced this pull request Jul 10, 2020
This is now default behavior in jupyter_client versions 5.3.5 and
6.1.5 and makes the previous change obsolete. This rolls back #820.
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

Successfully merging this pull request may close these issues.

2 participants