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

[REPL] fix lock ordering mistake in load_pkg #56215

Merged
merged 1 commit into from
Oct 17, 2024
Merged

[REPL] fix lock ordering mistake in load_pkg #56215

merged 1 commit into from
Oct 17, 2024

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Oct 17, 2024

Fixes #56206

Also fix waiting on the package_locks being always a no-op here.

Fixes #56206
@vtjnash vtjnash added REPL Julia's REPL (Read Eval Print Loop) backport 1.11 Change should be backported to release-1.11 labels Oct 17, 2024
Comment on lines +6 to -8
REPLExt = Base.require_stdlib(Pkg_pkgid, "REPLExt")
@lock Base.require_lock begin
REPLExt = Base.require_stdlib(Pkg_pkgid, "REPLExt")
Copy link
Member

Choose a reason for hiding this comment

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

require_stdlib locks require_lock for the entire function, so why does the lock need to be released between these operations?

Copy link
Member Author

Choose a reason for hiding this comment

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

It releases the lock many times internally

Copy link
Member

Choose a reason for hiding this comment

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

Ah so the additional lock layer prevents those from releasing fully

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. We could do an unlockall/relockall pair like wait does, but it is sort of always a concurrency bug if your application actually relies on that.

@vtjnash vtjnash merged commit 1f935af into master Oct 17, 2024
7 of 9 checks passed
@vtjnash vtjnash deleted the jn/56206 branch October 17, 2024 19:50
KristofferC pushed a commit that referenced this pull request Oct 18, 2024
@KristofferC KristofferC mentioned this pull request Oct 18, 2024
43 tasks
@giordano giordano removed the backport 1.11 Change should be backported to release-1.11 label Oct 19, 2024
KristofferC pushed a commit that referenced this pull request Oct 21, 2024
KristofferC added a commit that referenced this pull request Nov 21, 2024
Backported PRs:
- [x] #55886 <!-- irrationals: restrict assume effects annotations to
known types -->
- [x] #55867 <!-- update `hash` doc string: `widen` not required any
more -->
- [x] #56084 <!-- slightly improve inference in precompilation code -->
- [x] #56088 <!-- make `Base.ANSIIterator` have a concrete field -->
- [x] #54093 <!-- Fix `JULIA_CPU_TARGET` being propagated to workers
precompiling stdlib pkgimages -->
- [x] #56165 <!-- Fix markdown list in installation.md -->
- [x] #56148 <!-- Make loading work when stdlib deps are missing in the
manifest -->
- [x] #56174 <!-- Fix implicit `convert(String, ...)` in several places
-->
- [x] #56159 <!-- Add invalidation barriers for `displaysize` and
`implicit_typeinfo` -->
- [x] #56089 <!-- Call `MulAddMul` instead of multiplication in
_generic_matmatmul! -->
- [x] #56195 <!-- Include default user depot when JULIA_DEPOT_PATH has
leading empty entry -->
- [x] #56215 <!-- [REPL] fix lock ordering mistake in load_pkg -->
- [x] #56251 <!-- REPL: run repl hint generation for modeswitch chars
when not switching -->
- [x] #56092 <!-- stream: fix reading LibuvStream into array -->
- [x] #55870 <!-- fix infinite recursion in `promote_type` for
`Irrational` -->
- [x] #56227 <!-- Do not call `rand` during sysimage precompilation -->
- [x] #55741 <!-- Change annotations to use a NamedTuple -->
- [x] #56149 <!-- Specialize adding/subtracting mixed
Upper/LowerTriangular -->
- [x] #56214 <!-- fix precompile process flags -->
- [x] #54471
- [x] #55622
- [x] #55704
- [x] #55764
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Freeze when switching to pkg mode, when Pkg has not been loaded already.
3 participants