Stop the ClickHouse service from reopening clients after shutdown
What
ClickHouseService.onModuleDestroy closed its clients but left them in mainClient and clients. An insert landing after shutdown (a late event-log write from a test teardown, for instance) picked the closed client back up, or created a fresh one through connectToClient, and opened a new socket. Jest then never exited and the integration shard ran into its 30-minute timeout with every test passing.
onModuleDestroymarks the service destroyed, emptiesmainClientandclients, then closes what it held.connectToClientreturnsundefinedonce the service is destroyed, and closes a client that finished initialising after shutdown instead of keeping it.
Callers already treat an undefined client as "ClickHouse not configured", so a late insert is dropped instead of reopening a connection.
Why now
Server integration shard 16 hung this way twice in a row on #30521 (all 320 tests passed, the job was cancelled at the timeout). Split out of that PR so the settings page stays front-end only.
Test
Typecheck, lint and the server unit suites passed on these exact commits in #30521's CI.