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:
Alex Ovsienko
2025-12-07 20:39:43 -08:00
committed by LUCI CQ
parent f8cc59a94b
commit ac1b095b09
2 changed files with 7 additions and 42 deletions

18
siso.py
View File

@@ -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()