https://github.com/JuliaLang/julia
Revision b029fbfe8a24a3cc381b2adbfaf2520a3e43cca4 authored by Jameson Nash on 19 January 2023, 19:55:48 UTC, committed by GitHub on 19 January 2023, 19:55:48 UTC
When the program goes to write out a precompile file, we would like for
the process to first reach a point where it is not still running
background tasks and work. This ensures that the precompile file is in a
consistent state, and isn't forgetting or delaying intended work.

In the future, we may want to add an `atexit` hook (after the other
`atexit` hooks) which optionally calls this function for regular code
too, probably under programmatic control and/or command line argument
control for the user to decide. And we would need to decide how to close
stdin first, so it doesn't continue to keep the program alive.

Add uv_ref and uv_unref internal hooks for this. You probably really
don't want to call these (as they may stop you from getting events on
these objects also), but very specific internal things will need them
for this to work.

Also (mostly unrelated) rewrite a Profile test to conform to best-practices.
Previously, the loop was expecting to observe the Profile test printing
even though nothing kept it alive (there was no reads on stdin).
We fix the design of that test, but also include a patch inside
`jl_process_events` to ensure the loop is alive and will handle events,
to avoid breaking anyone else who was relying on this pattern.

To assist package authors fix errors, we automatically print a note if
this new functionality is causing delays. They then need to ensure they
are calling close explicitly (not relying solely on finalizers), when
appropriate, and are cleaning up other resources (or calling the new
`Base.uv_unref`) also.

Fix #45170
1 parent 87b8896
History
Tip revision: b029fbfe8a24a3cc381b2adbfaf2520a3e43cca4 authored by Jameson Nash on 19 January 2023, 19:55:48 UTC
Wait for all tasks before writing precompile files (#46571)
Tip revision: b029fbf
File Mode Size
.devcontainer
.github
base
cli
contrib
deps
doc
etc
src
stdlib
test
.buildkite-external-version -rw-r--r-- 5 bytes
.clang-format -rw-r--r-- 3.3 KB
.codecov.yml -rw-r--r-- 52 bytes
.git-blame-ignore-revs -rw-r--r-- 294 bytes
.gitattributes -rw-r--r-- 65 bytes
.gitignore -rw-r--r-- 507 bytes
.mailmap -rw-r--r-- 12.1 KB
CITATION.bib -rw-r--r-- 513 bytes
CITATION.cff -rw-r--r-- 940 bytes
CONTRIBUTING.md -rw-r--r-- 23.1 KB
HISTORY.md -rw-r--r-- 363.4 KB
LICENSE.md -rw-r--r-- 1.3 KB
Make.inc -rw-r--r-- 51.6 KB
Makefile -rw-r--r-- 30.0 KB
NEWS.md -rw-r--r-- 1.5 KB
README.md -rw-r--r-- 7.3 KB
THIRDPARTY.md -rw-r--r-- 3.7 KB
VERSION -rw-r--r-- 11 bytes
julia.spdx.json -rw-r--r-- 35.8 KB
sysimage.mk -rw-r--r-- 4.1 KB

README.md

back to top