From d2bfdb09d31e39b70c4e299f3f6bb866dfe2b458 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Thu, 26 Oct 2023 17:57:58 -0400 Subject: [PATCH] add more explanation to IO-waiting message during precompilation --- doc/src/devdocs/precompile_hang.md | 4 ++-- src/jl_uv.c | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/doc/src/devdocs/precompile_hang.md b/doc/src/devdocs/precompile_hang.md index 738de1808ba96..d1b913d443194 100644 --- a/doc/src/devdocs/precompile_hang.md +++ b/doc/src/devdocs/precompile_hang.md @@ -12,8 +12,8 @@ If you follow the advice and hit `Ctrl-C`, you might see 1 dependency had warnings during precompilation: ┌ Test1 [ac89d554-e2ba-40bc-bc5c-de68b658c982] │ [pid 2745] waiting for IO to finish: -│ TYPE[FD/PID] @UV_HANDLE_T->DATA -│ timer @0x55580decd1e0->0x7f94c3a4c340 +│ Handle type uv_handle_t->data +│ timer 0x55580decd1e0->0x7f94c3a4c340 ``` and, depending on how long you waited, this may repeat. diff --git a/src/jl_uv.c b/src/jl_uv.c index 281dd798dbb36..62dc3a628d085 100644 --- a/src/jl_uv.c +++ b/src/jl_uv.c @@ -51,9 +51,9 @@ static void walk_print_cb(uv_handle_t *h, void *arg) npad += strlen(type); pad += npad < strlen(pad) ? npad : strlen(pad); if (fd == -1) - jl_safe_printf(" %s %s@%p->%p\n", type, pad, (void*)h, (void*)h->data); + jl_safe_printf(" %s %s%p->%p\n", type, pad, (void*)h, (void*)h->data); else - jl_safe_printf(" %s[%zd] %s@%p->%p\n", type, (size_t)fd, pad, (void*)h, (void*)h->data); + jl_safe_printf(" %s[%zd] %s%p->%p\n", type, (size_t)fd, pad, (void*)h, (void*)h->data); } static void wait_empty_func(uv_timer_t *t) @@ -63,9 +63,12 @@ static void wait_empty_func(uv_timer_t *t) if (!uv_loop_alive(t->loop)) return; jl_safe_printf("\n[pid %zd] waiting for IO to finish:\n" - " TYPE[FD/PID] @UV_HANDLE_T->DATA\n", + " Handle type uv_handle_t->data\n", (size_t)uv_os_getpid()); uv_walk(jl_io_loop, walk_print_cb, NULL); + if (jl_generating_output() && jl_options.incremental) { + jl_safe_printf("This means that a package has started a background task or event source that has not finished running. For precompilation to complete successfully, the event source needs to be closed explicitly. See the developer documentation on fixing precompilation hangs for more help.\n"); + } jl_gc_collect(JL_GC_FULL); }