mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
siso: do not restart the collector if projects don't match.
The correct project is set at runtime by siso. Bug: b/455433899 Change-Id: Ibe1d348729e53425f27812e83a5c7f466a6a6964 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7234199 Commit-Queue: Alex Ovsienko <ovsienko@google.com> Reviewed-by: Junji Watanabe <jwata@google.com>
This commit is contained in:
18
siso.py
18
siso.py
@@ -137,10 +137,9 @@ def _start_collector(siso_path: str, sockets_file: Optional[str],
|
||||
|
||||
class Status(Enum):
|
||||
HEALTHY = 1
|
||||
WRONG_PROJECT = 2
|
||||
WRONG_ENDPOINT = 3
|
||||
UNHEALTHY = 4
|
||||
DEAD = 5
|
||||
WRONG_ENDPOINT = 2
|
||||
UNHEALTHY = 3
|
||||
DEAD = 4
|
||||
|
||||
def collector_status() -> Status:
|
||||
conn = http.client.HTTPConnection(f"localhost:{_OTLP_HEALTH_PORT}")
|
||||
@@ -156,8 +155,6 @@ def _start_collector(siso_path: str, sockets_file: Optional[str],
|
||||
status = json.loads(response.read())
|
||||
if not status["healthy"] or status["status"] != "StatusOK":
|
||||
return Status.UNHEALTHY
|
||||
if fetch_project(conn) != project:
|
||||
return Status.WRONG_PROJECT
|
||||
endpoint = fetch_receiver_endpoint(conn)
|
||||
|
||||
expected_endpoint = sockets_file or _OTLP_DEFAULT_TCP_ENDPOINT
|
||||
@@ -166,15 +163,6 @@ def _start_collector(siso_path: str, sockets_file: Optional[str],
|
||||
|
||||
return Status.HEALTHY
|
||||
|
||||
def fetch_project(conn: http.client.HTTPConnection) -> str:
|
||||
conn.request("GET", "/health/config")
|
||||
response = conn.getresponse()
|
||||
resp_json = json.loads(response.read())
|
||||
try:
|
||||
return resp_json["exporters"]["googlecloud"]["project"]
|
||||
except KeyError:
|
||||
return ""
|
||||
|
||||
def fetch_receiver_endpoint(conn: http.client.HTTPConnection) -> str:
|
||||
conn.request("GET", "/health/config")
|
||||
response = conn.getresponse()
|
||||
|
||||
Reference in New Issue
Block a user