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

Throw away any existing uv_default_loop, recreate after fork #3492

Closed
wants to merge 1 commit into from

Conversation

Spudz76
Copy link
Contributor

@Spudz76 Spudz76 commented Jun 4, 2024

(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
Copy link
Owner

xmrig commented Jun 4, 2024

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
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
Copy link
Contributor Author

Spudz76 commented Jun 4, 2024

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
realsetvin pushed a commit to realsetvin/norig that referenced this pull request Aug 13, 2024
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