Hi Ftrack Team,
we would like to use the ftrack session in threads, but, unfortunately, it seems that ftrack_api is not thread safe.
When we are using the session in multiple threads the return of the attribute value of the entities is a Symbol (NOT SET).
Please find below a script where we were able to reproduce the issue:
from multiprocessing.dummy import Pool as ThreadPool
import ftrack_api
from ftrack_api.symbol import Symbol
session = ftrack_api.Session()
def check_keys(entity):
for key in entity.keys():
if isinstance(entity[key], Symbol):
print entity, ': ', key
def check_children(entity):
if 'children' in entity.keys():
for child in entity['children']:
check_keys(entity=child)
check_children(entity=child)
def main():
projects = session.query("Project").all()
pool = ThreadPool()
pool.map(check_children, projects)
if __name__ == "__main__":
main()
ftrack_api version: 1.3.2
ftrack server version: 3.5.6