]> Git Repo - qemu.git/commit
migration/multifd: fix hangup with TLS-Multifd due to blocking handshake
authorChuan Zheng <[email protected]>
Fri, 6 Nov 2020 06:24:53 +0000 (14:24 +0800)
committerDr. David Alan Gilbert <[email protected]>
Thu, 12 Nov 2020 14:35:29 +0000 (14:35 +0000)
commita1af605bd5ade1a6dd571f553a6746b97f3d6869
tree120240d42ba9e7bc18b322f3599c12ffa33993df
parent136fc6aa2cf38205fa3b47e155ebac11baccc789
migration/multifd: fix hangup with TLS-Multifd due to blocking handshake

The qemu main loop could hang up forever when we enable TLS+Multifd.
The Src multifd_send_0 invokes tls handshake, it sends hello to sever
and wait response.
However, the Dst main qemu loop has been waiting recvmsg() for multifd_recv_1.
Both of Src and Dst main qemu loop are blocking and waiting for reponse which
results in hanging up forever.

Src: (multifd_send_0)                                              Dst: (multifd_recv_1)
multifd_channel_connect                                            migration_channel_process_incoming
  multifd_tls_channel_connect                                        migration_tls_channel_process_incoming
    multifd_tls_channel_connect                                        qio_channel_tls_handshake_task
       qio_channel_tls_handshake                                         gnutls_handshake
          qio_channel_tls_handshake_task                                       ...
            qcrypto_tls_session_handshake                                      ...
              gnutls_handshake                                                 ...
                   ...                                                         ...
                recvmsg (Blocking I/O waiting for response)                recvmsg (Blocking I/O waiting for response)

Fix this by offloadinig handshake work to a background thread.

Reported-by: Yan Jin <[email protected]>
Suggested-by: Daniel P. BerrangĂ© <[email protected]>
Signed-off-by: Chuan Zheng <[email protected]>
Message-Id: <1604643893[email protected]>
Reviewed-by: Daniel P. BerrangĂ© <[email protected]>
Signed-off-by: Dr. David Alan Gilbert <[email protected]>
migration/multifd.c
This page took 0.024983 seconds and 4 git commands to generate.