comparison src/director/director-connection.c @ 16699:9531ec8afe8b

director: Reset last-seen-sync-sequence after remote director restarts.
author Timo Sirainen <tss@iki.fi>
date Wed, 21 Aug 2013 23:30:07 +0300
parents f7a37b169f4a
children 17389ac3cb66
comparison
equal deleted inserted replaced
16698:60b8746e6cfe 16699:9531ec8afe8b
403 /* the host shouldn't be removed at this point, but if for some 403 /* the host shouldn't be removed at this point, but if for some
404 reason it is we don't want to crash */ 404 reason it is we don't want to crash */
405 conn->host->removed = FALSE; 405 conn->host->removed = FALSE;
406 director_host_ref(conn->host); 406 director_host_ref(conn->host);
407 /* make sure we don't keep old sequence values across restarts */ 407 /* make sure we don't keep old sequence values across restarts */
408 conn->host->last_seq = 0; 408 director_host_restarted(conn->host);
409 409
410 next_comm_attempt = conn->host->last_protocol_failure + 410 next_comm_attempt = conn->host->last_protocol_failure +
411 DIRECTOR_PROTOCOL_FAILURE_RETRY_SECS; 411 DIRECTOR_PROTOCOL_FAILURE_RETRY_SECS;
412 if (next_comm_attempt > ioloop_time) { 412 if (next_comm_attempt > ioloop_time) {
413 /* the director recently sent invalid protocol data, 413 /* the director recently sent invalid protocol data,
644 /* already have this. just reset its last_network_failure 644 /* already have this. just reset its last_network_failure
645 timestamp, since it might be up now. */ 645 timestamp, since it might be up now. */
646 host->last_network_failure = 0; 646 host->last_network_failure = 0;
647 if (host->last_seq != 0) { 647 if (host->last_seq != 0) {
648 /* it also may have been restarted, reset last_seq */ 648 /* it also may have been restarted, reset last_seq */
649 host->last_seq = 0; 649 director_host_restarted(host);
650 forward = TRUE; 650 forward = TRUE;
651 } 651 }
652 } else { 652 } else {
653 /* save the director and forward it */ 653 /* save the director and forward it */
654 host = director_host_add(conn->dir, &ip, port); 654 host = director_host_add(conn->dir, &ip, port);
1589 struct director_connection *conn; 1589 struct director_connection *conn;
1590 1590
1591 i_assert(!host->removed); 1591 i_assert(!host->removed);
1592 1592
1593 /* make sure we don't keep old sequence values across restarts */ 1593 /* make sure we don't keep old sequence values across restarts */
1594 host->last_seq = 0; 1594 director_host_restarted(host);
1595 1595
1596 conn = director_connection_init_common(dir, fd); 1596 conn = director_connection_init_common(dir, fd);
1597 conn->name = i_strdup_printf("%s/out", host->name); 1597 conn->name = i_strdup_printf("%s/out", host->name);
1598 conn->host = host; 1598 conn->host = host;
1599 director_host_ref(host); 1599 director_host_ref(host);