[rhinstaller/blivet/pulls/78 rhel7-branch] Fix "anaconda hangs while trying to discover iscsi..." (#1166652)

jkonecny12 installerbot-noreply at redhat.com
Tue Apr 14 11:56:36 UTC 2015


> @@ -277,10 +319,41 @@ def discover(self, ipaddr, port="3260", username=None, password=None,
>                                                   reverse_password=r_password)
>              self.startup()
>  
> -            # Note may raise an IOError
> -            found_nodes = libiscsi.discover_sendtargets(address=ipaddr,
> -                                                        port=int(port),
> -                                                        authinfo=authinfo)
> +            # start libiscsi discover_sendtargets in a new process
> +            # threads can't be used here because the libiscsi library
> +            # using signals internally which are send to bad thread
> +            (con_recv, con_write) = Pipe(False)
> +            p = Process(target=_call_discover_targets, args=(con_write,
> +                                                             ipaddr,
> +                                                             port,
> +                                                             authinfo, ))
> +
> +            p.start()
> +
> +            found_nodes = []
> +
> +            try:
> +                (ok, data) = con_recv.recv()
> +
> +                if not ok:
> +                    found_nodes =  None
> +                    log.debug("iSCSI: error raised when "
> +                              "discover_sendtargets process called: %s",
> +                              str(data))
> +
> +            except EOFError:
> +                found_nodes = None
> +                log.debug("iSCSI: can't receive response from "
> +                          "_call_discover_targets")

I see, my bad.
I'll fix this locally.

-- 
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/78#discussion_r28320000


More information about the anaconda-patches mailing list