Skip to content

Throw away any existing uv_default_loop, recreate after fork#3492

Closed
Spudz76 wants to merge 1 commit into
xmrig:devfrom
Spudz76:pr-fix-uv_loop
Closed

Throw away any existing uv_default_loop, recreate after fork#3492
Spudz76 wants to merge 1 commit into
xmrig:devfrom
Spudz76:pr-fix-uv_loop

Conversation

@Spudz76

@Spudz76 Spudz76 commented Jun 4, 2024

Copy link
Copy Markdown
Contributor

(also) Fixes #3455

This is an alternate approach to the problem, it does not function any differently however might be cleaner. Simply destroy any existing default loop to cause a new one to be created on the next uv_default_loop() call (in Signals constructor). This completely avoids using the experimental/non-guaranteed uv_loop_fork() function.

@xmrig

xmrig commented Jun 4, 2024

Copy link
Copy Markdown
Owner

Is uv_loop_close really needed? It does not look right to close the freshly created default loop and create it again after. Also, the addition of #include <uv.h> is not required in App.h.
Thank you.

@xmrig xmrig added this to the v6 milestone Jun 4, 2024
@SChernykh

Copy link
Copy Markdown
Contributor

uv_loop_close will be a no-op at best. If any libuv handle was created at this point, uv_loop_close will fail and return UV_EBUSY error. If no handles were created, there is no point in closing the loop.

@Spudz76

Spudz76 commented Jun 4, 2024

Copy link
Copy Markdown
Contributor Author

I agree but it works. So it must be doing something.

@xmrig xmrig closed this Jun 4, 2024
@Spudz76 Spudz76 deleted the pr-fix-uv_loop branch June 4, 2024 21:35
Ra2-IFV pushed a commit to ifvlaboratory/xmrig that referenced this pull request Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants