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

Move OperationInitializer Construction to Dagger Object Graph #4986

Merged
merged 2 commits into from
Jan 9, 2024

Conversation

nbauernfeind
Copy link
Member

@nbauernfeind nbauernfeind commented Dec 23, 2023

This sets the proper operation initializer for the refresh thread should the UpdateGraph be started in single threaded mode. This was detected in #4975 and is a part of that fix.

@nbauernfeind nbauernfeind added configuration core Core development tasks NoDocumentationNeeded NoReleaseNotesNeeded No release notes are needed. labels Dec 23, 2023
@nbauernfeind nbauernfeind added this to the December 2023 milestone Dec 23, 2023
@nbauernfeind nbauernfeind self-assigned this Dec 23, 2023
Copy link
Member

@niloc132 niloc132 left a comment

Choose a reason for hiding this comment

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

I love this, thank you for this massive improvement on what I wrote. The parts I don't like... are my problem anyway, for a followup patch to make ScriptSession creation nicer anyway.

Copy link
Member

@rcaudy rcaudy left a comment

Choose a reason for hiding this comment

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

Minor comments. Please ensure that nightlies are passing.

@@ -69,11 +69,18 @@ def start_jvm_for_tests(jvm_props: Dict[str, str] = None):
# Set up a Deephaven Python session
py_scope_jpy = jpy.get_type("io.deephaven.engine.util.PythonScopeJpyImpl").ofMainGlobals()
global py_dh_session

no_op_thread_factory = jpy.get_type("io.deephaven.util.thread.ThreadInitializationFactory").NO_OP
Copy link
Member

Choose a reason for hiding this comment

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

I think this should follow the _ convention.

Copy link
Member

Choose a reason for hiding this comment

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

underscore is for top-level stuff that shouldn't be imported from other modules, not necessary here

Copy link
Contributor

@jmao-denver jmao-denver Jan 9, 2024

Choose a reason for hiding this comment

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

underscore doesn't apply to auto-variables in the function scope, so the naming is fine here, though I prefer to use the _j_ or j_ prefix if an object/variable comes from Java..

return PeriodicUpdateGraph.newBuilder(PeriodicUpdateGraph.DEFAULT_UPDATE_GRAPH_NAME)
.numUpdateThreads(PeriodicUpdateGraph.NUM_THREADS_DEFAULT_UPDATE_GRAPH)
.threadInitializationFactory(threadInitializationFactory)
Copy link
Member

Choose a reason for hiding this comment

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

@niloc132 Was Python debugging broken without this?

Copy link
Member

Choose a reason for hiding this comment

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

Likely, yes, but we don't have tests for this.

_JUpdateGraph = jpy.get_type("io.deephaven.engine.updategraph.impl.PeriodicUpdateGraph")
docs_update_graph = _JUpdateGraph.newBuilder("PYTHON_DOCS").build()
docs_update_graph = _JUpdateGraph.newBuilder("PYTHON_DOCS") \
Copy link
Member

Choose a reason for hiding this comment

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

Same comment as on the test helper. Maybe consult with @jmao-denver to make sure we have the right conventions.

Copy link
Member

Choose a reason for hiding this comment

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

these arguably could be _ prefixed... but this is configuration for running sphinx, not something that users can use (or that we would import anywhere else), so shouldn't matter.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1, and the same comment above applies here too.

Copy link
Contributor

@jmao-denver jmao-denver left a comment

Choose a reason for hiding this comment

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

The Python changes LGTM

@@ -69,11 +69,18 @@ def start_jvm_for_tests(jvm_props: Dict[str, str] = None):
# Set up a Deephaven Python session
py_scope_jpy = jpy.get_type("io.deephaven.engine.util.PythonScopeJpyImpl").ofMainGlobals()
global py_dh_session

no_op_thread_factory = jpy.get_type("io.deephaven.util.thread.ThreadInitializationFactory").NO_OP
Copy link
Contributor

@jmao-denver jmao-denver Jan 9, 2024

Choose a reason for hiding this comment

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

underscore doesn't apply to auto-variables in the function scope, so the naming is fine here, though I prefer to use the _j_ or j_ prefix if an object/variable comes from Java..

_JUpdateGraph = jpy.get_type("io.deephaven.engine.updategraph.impl.PeriodicUpdateGraph")
docs_update_graph = _JUpdateGraph.newBuilder("PYTHON_DOCS").build()
docs_update_graph = _JUpdateGraph.newBuilder("PYTHON_DOCS") \
Copy link
Contributor

Choose a reason for hiding this comment

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

+1, and the same comment above applies here too.

Copy link
Member

@rcaudy rcaudy left a comment

Choose a reason for hiding this comment

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

Approving based on Jianfeng's feedback. Ready to merge if nightlies pass.

@nbauernfeind
Copy link
Member Author

@nbauernfeind nbauernfeind merged commit 3229d71 into deephaven:main Jan 9, 2024
18 of 19 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
configuration core Core development tasks NoDocumentationNeeded NoReleaseNotesNeeded No release notes are needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants