mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-27 23:49:04 +00:00
red_channel: on migration target, start sending ping messages only after the client's migration has completed
The connection to the target server is established before migration starts. However, the client reads and replies to messages from the server only after migration completes. Thus, we better not send ping msgs from the target before migration completes (because the observed roundtrip duration will be bigger than the real one).
This commit is contained in:
parent
df26036552
commit
b71ccec83e
@ -805,7 +805,9 @@ RedChannelClient *red_channel_client_create(int size, RedChannel *channel, RedCl
|
||||
if (monitor_latency) {
|
||||
rcc->latency_monitor.timer = channel->core->timer_add(
|
||||
red_channel_client_ping_timer, rcc);
|
||||
red_channel_client_start_ping_timer(rcc, PING_TEST_IDLE_NET_TIMEOUT_MS);
|
||||
if (!client->during_target_migrate) {
|
||||
red_channel_client_start_ping_timer(rcc, PING_TEST_IDLE_NET_TIMEOUT_MS);
|
||||
}
|
||||
rcc->latency_monitor.roundtrip = -1;
|
||||
}
|
||||
|
||||
@ -832,6 +834,9 @@ static void red_channel_client_seamless_migration_done(RedChannelClient *rcc)
|
||||
/* migration completion might have been triggered from a different thread
|
||||
* than the main thread */
|
||||
main_dispatcher_seamless_migrate_dst_complete(rcc->client);
|
||||
if (rcc->latency_monitor.timer) {
|
||||
red_channel_client_start_ping_timer(rcc, PING_TEST_IDLE_NET_TIMEOUT_MS);
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&rcc->client->lock);
|
||||
}
|
||||
@ -2004,6 +2009,8 @@ void red_client_set_main(RedClient *client, MainChannelClient *mcc) {
|
||||
|
||||
void red_client_semi_seamless_migrate_complete(RedClient *client)
|
||||
{
|
||||
RingItem *link;
|
||||
|
||||
pthread_mutex_lock(&client->lock);
|
||||
if (!client->during_target_migrate || client->seamless_migrate) {
|
||||
spice_error("unexpected");
|
||||
@ -2011,6 +2018,13 @@ void red_client_semi_seamless_migrate_complete(RedClient *client)
|
||||
return;
|
||||
}
|
||||
client->during_target_migrate = FALSE;
|
||||
RING_FOREACH(link, &client->channels) {
|
||||
RedChannelClient *rcc = SPICE_CONTAINEROF(link, RedChannelClient, client_link);
|
||||
|
||||
if (rcc->latency_monitor.timer) {
|
||||
red_channel_client_start_ping_timer(rcc, PING_TEST_IDLE_NET_TIMEOUT_MS);
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&client->lock);
|
||||
reds_on_client_semi_seamless_migrate_complete(client);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user