Closed ADBond closed 1 month ago
See this docs page - specifically:
session_timeout - Number of seconds of inactivity before the identified by the session id will timeout and no longer be considered valid. Defaults to 60 seconds.
Couple of things then:
ClickhouseAPI
until we actually need itunion_default_mode
more frequently
Triggered in
linker.clustering.cluster_pairwise_predictions_at_threshold()
: get SQL execution errorDB::Exception: Expected ALL or DISTINCT in SelectWithUnion query, because setting (union_default_mode) is empty
.Not sure exactly what's going on here, but have managed to narrow down problem slightly.
Seems that if we wait too long (I guess after instantiation of the
ClickhouseAPI
??) then theSET union_default_mode = 'DISTINCT'
gets 'forgotten'.To see this chuck a
time.sleep(65)
at the very start of this test and it will fail. This is somewhere around the limit of the time -time.sleep(60)
runs fine 🤷 .Don't know the root cause of this, but at a guess the
clickhouse_connect.driver.client.Client
has some kind of reset after a time that means the setting gets wiped, and as that setting only gets set inClickhouseAPI.__init__()
it isn't refreshed, so we hit the same issue we originally had. Might also be some timer in the Clickhouse Server itself.