In some use cases, user code may change the environment variable KACHERY_CLOUD_DIR during execution. This can lead to a mismatch between the return information of get_client_id() (which is used to construct payload requests) and get_client_info() (which is used in init()) if there is a different previously cached value in _global_init. See this issue for example.
Suggestion:
Inside of get_client_info(), if there is a cahced value in _global_init, check that the client id is the same as the returned value from get_client_id(). If not, log a warning to help users debug.
https://github.com/flatironinstitute/kachery-cloud/blob/e5dd5fb57d4aa556f4a43523e0324bc472390c17/kachery_cloud/init.py#L28C1-L28C7
In some use cases, user code may change the environment variable
KACHERY_CLOUD_DIR
during execution. This can lead to a mismatch between the return information ofget_client_id()
(which is used to construct payload requests) andget_client_info()
(which is used ininit()
) if there is a different previously cached value in_global_init
. See this issue for example.Suggestion:
Inside of
get_client_info()
, if there is a cahced value in_global_init
, check that the client id is the same as the returned value fromget_client_id()
. If not, log a warning to help users debug.