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

jkonecny12 installerbot-noreply at redhat.com
Thu Apr 23 14:39:42 UTC 2015


> @@ -277,12 +332,37 @@ 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)
> -            if found_nodes is None:
> +            # 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()
> +
> +            try:
> +                (ok, data) = con_recv.recv()
> +                if not ok:
> +                    log.debug("iSCSI: exception raised when "
> +                              "discover_sendtargets process called: %s",
> +                              str(data))
> +            except EOFError:
> +                ok = False
> +                log.error("iSCSI: can't receive response from "
> +                          "_call_discover_targets")
> +
> +            p.join()
> +
> +            # convert dictionary back to iscsi nodes object
> +            if ok is True:

I will change it before push

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


More information about the anaconda-patches mailing list