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

network: avoid registering GTypes from multiple threads (#1366271) #746

Conversation

rvykydal
Copy link
Contributor

An attempt to derefrence an GEnum value causes a lazy registering of
GType which is not thread-safe. It is however done from the
wait_for_connecting_NM_thread() thread.

Let's just create the types that are potentially used from the
wait_for_connecting_NM_thread() thread in advance.

Resolves: rhbz#1366271

@jkonecny12
Copy link
Member

You are getting these pylint errors:

************* Module ../pyanaconda/nm.py
W0104: 26,0: : Statement seems to have no effect
W0104: 27,0: : Statement seems to have no effect
W0104: 28,0: : Statement seems to have no effect
W0104: 29,0: : Statement seems to have no effect
************* Module ../pyanaconda/network.py
W0104: 52,0: : Statement seems to have no effect

@@ -48,6 +48,8 @@
from pyanaconda.regexes import HOSTNAME_PATTERN_WITHOUT_ANCHORS

from gi.repository import NetworkManager
# # Register the types so that the use in threads is safe
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have here one '#' more than it's needed. It looks to me, like copy-paste error.

@vpodzime
Copy link
Contributor

WTH?! Wow...

@rvykydal rvykydal force-pushed the rhel7-branch-avoid-registering-gtypes-from-multiple-threads branch from 24a6514 to 9e32357 Compare September 12, 2016 12:53
@rvykydal
Copy link
Contributor Author

jenkins, test this please

@rvykydal
Copy link
Contributor Author

Filed a BZ for gobject3:
https://bugzilla.redhat.com/show_bug.cgi?id=1370124
For 7.3 at this stage I'd go with Lubomir's patch

@M4rtinK
Copy link
Contributor

M4rtinK commented Sep 13, 2016

Looks good to me, ACK!
Just a little suggestion - maybe a link to the gobject3 bug could be mentioned somewhere in the patch - in a comment/commit message ? :)

@M4rtinK M4rtinK added the ACK label Sep 13, 2016
An attempt to derefrence an GEnum value causes a lazy registering of
GType which is not thread-safe. It is however done from the
wait_for_connecting_NM_thread() thread.

Let's just create the types that are potentially used from the
wait_for_connecting_NM_thread() thread in advance.

rvykydal@redhat.com: filed BZ for pygobject3: 1370124

Resolves: rhbz#1366271
@rvykydal rvykydal force-pushed the rhel7-branch-avoid-registering-gtypes-from-multiple-threads branch from 9e32357 to 3167179 Compare September 13, 2016 14:10
@rvykydal rvykydal merged commit cfff683 into rhinstaller:rhel7-branch Sep 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants