Ecdar / Ecdar-GUI

A graphical tool for modeling using ECDAR (Environment for Compositional Design and Analysis of Real Time Systems)
MIT License
3 stars 5 forks source link

Fix so new connections are only added as backend connections after they are 'ready' #133

Closed seblund closed 1 year ago

seblund commented 1 year ago

New connections are added to the backend connections here: https://github.com/Ecdar/Ecdar-GUI/blob/9ca653b7817706f132d88c8a773a0487e99c6038/src/main/java/ecdar/backend/BackendDriver.java#L153

But that is before the updateComponents query has completed, so a query can take the backend before it is ready. This results in a bunch of non-deterministic errors when executing queries, one being the UNAVAILABLE: io exception error.

The backend should only be added on the onCompleted as is already done: https://github.com/Ecdar/Ecdar-GUI/blob/9ca653b7817706f132d88c8a773a0487e99c6038/src/main/java/ecdar/backend/BackendDriver.java#L171

After this small fix you can spam queries to your heart's content with no issues :)