Strumenta / starlasu-lionweb-repository-client

0 stars 0 forks source link

KolasuClient cannot be shared between threads #22

Open alessiostalla opened 5 months ago

alessiostalla commented 5 months ago

In particular storeTree calls nodeConverter.clearNodesMapping() and that causes NPEs if other concurrent operations are using the mappings. Apart from that, in general, since the converter's node mappings are maps with no explicit provisions for multithreading, spurious errors may occur.

Of course a workaround is to create a new client for each thread, but that requires re-registering all the languages, we don't have a way to cache and reuse those.

alessiostalla commented 5 months ago

At a minimum, this should be documented.

ftomassetti commented 5 months ago

Would this be solved by making the nodeConverter thread-safe?

alessiostalla commented 5 months ago

No because it assumes mappings aren't cleared during its other operations