-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #852 from projectcalico/smc-concurrent-resync
[Work in progress] Implement concurrent resync
- Loading branch information
Showing
48 changed files
with
4,678 additions
and
1,139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
[run] | ||
include = | ||
calico/etcddriver/* | ||
calico/felix/* | ||
calico/openstack/* | ||
calico/*.py | ||
omit = | ||
calico/test/* | ||
calico/felix/test/* | ||
calico/openstack/test/* | ||
calico/etcddriver/test/* | ||
branch = True | ||
concurrency = eventlet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# Copyright (c) 2014, 2015 Metaswitch Networks | ||
# All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
""" | ||
calico.etcddriver.__main__ | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Main entry point for the etcd driver, responsible for basic logging config | ||
and starting our threads. | ||
""" | ||
|
||
import logging | ||
import os | ||
import socket | ||
import sys | ||
|
||
from calico.etcddriver import driver | ||
from calico import common | ||
|
||
_log = logging.getLogger(__name__) | ||
|
||
last_ppid = os.getppid() | ||
common.default_logging(gevent_in_use=False, | ||
syslog_executable_name="calico-felix-etcd") | ||
|
||
felix_sck = socket.socket(socket.AF_UNIX, | ||
socket.SOCK_STREAM) | ||
try: | ||
felix_sck.connect(sys.argv[1]) | ||
except: | ||
_log.exception("Failed to connect to Felix") | ||
raise | ||
|
||
etcd_driver = driver.EtcdDriver(felix_sck) | ||
etcd_driver.start() | ||
|
||
while not etcd_driver.join(timeout=1): | ||
parent_pid = os.getppid() | ||
# Defensive, just in case we don't get a socket error, check if the | ||
# parent PID has changed, indicating that Felix has died. | ||
if parent_pid == 1 or parent_pid != last_ppid: | ||
_log.critical("Process adopted, assuming felix has died") | ||
etcd_driver.stop() | ||
break | ||
_log.critical("Driver shutting down.") |
Oops, something went wrong.