Skip to content

Commit

Permalink
add more explanation to IO-waiting message during precompilation
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson authored and timholy committed Nov 3, 2023
1 parent 25e9baf commit d2bfdb0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions doc/src/devdocs/precompile_hang.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 6 additions & 3 deletions src/jl_uv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}

Expand Down

0 comments on commit d2bfdb0

Please sign in to comment.