comparison src/director/director-connection.c @ 18708:51ee438392c7

director: Moving a user to another host sometimes caused the move to fail. It could have given "User hash .. is being redirected to two hosts" error and afterwards moved the user back to its original host.
author Timo Sirainen <tss@iki.fi>
date Fri, 15 May 2015 16:44:45 +0300
parents b7aed6290e7e
children 0ee3e734249a
comparison
equal deleted inserted replaced
18707:e0a17714f0c9 18708:51ee438392c7
504 and we should have as well. use the new host. */ 504 and we should have as well. use the new host. */
505 dir_debug("user refresh: %u is nearly expired, " 505 dir_debug("user refresh: %u is nearly expired, "
506 "replacing host %s with %s", username_hash, 506 "replacing host %s with %s", username_hash,
507 net_ip2addr(&user->host->ip), net_ip2addr(&host->ip)); 507 net_ip2addr(&user->host->ip), net_ip2addr(&host->ip));
508 ret = TRUE; 508 ret = TRUE;
509 } else if (user->kill_state != USER_KILL_STATE_NONE &&
510 user->kill_state < USER_KILL_STATE_DELAY) {
511 /* user is still being moved - ignore conflicting host updates
512 from other directors who don't yet know about the move. */
513 dir_debug("user refresh: %u is being moved, "
514 "preserve its host %s instead of replacing with %s",
515 username_hash, net_ip2addr(&user->host->ip),
516 net_ip2addr(&host->ip));
517 host = user->host;
509 } else { 518 } else {
510 /* non-weak user received a non-weak update with 519 /* non-weak user received a non-weak update with
511 conflicting host. this shouldn't happen. */ 520 conflicting host. this shouldn't happen. */
512 string_t *str = t_str_new(128); 521 string_t *str = t_str_new(128);
513 522