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

Fix register_comm invalidations #1134

Merged
merged 1 commit into from
Dec 11, 2024
Merged

Conversation

halleysfifthinc
Copy link
Contributor

Minor bug: register_comm gets invalidated by design, when other packages (WebIO, JSServe, and Bonito that I'm aware of) define a new register_comm method.

Invalidation reproducer (from Jupyter):

using IJulia, SnoopCompileCore

invs = @snoop_invalidations using WebIO;

using SnoopCompile, AbstractTrees
trees = invalidation_trees(invs)

which gives

 inserting register_comm(comm::IJulia.CommManager.Comm{:webio_comm}, x) @ IJuliaExt ~/.julia/dev/WebIO/ext/IJuliaExt.jl:19 invalidated:
   backedges: 1: superseding register_comm(comm::IJulia.CommManager.Comm, data) @ IJulia.CommManager ~/Dropbox/documents/technology/development/julia-dev/IJulia/src/comm_manager.jl:92 with MethodInstance for register_comm(::IJulia.CommManager.Comm, ::IJulia.Msg) (1 children)

This PR changes the register_comm call to use invokelatest. This shouldn't be a performance sensitive issue, since register_comm should normally only be called once per comm connection.

@stevengj stevengj merged commit 7d1030e into JuliaLang:master Dec 11, 2024
9 checks passed
@halleysfifthinc halleysfifthinc deleted the patch-1 branch December 11, 2024 01:32
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