AntonShuvaev / elasticsearch4idea

Elasticsearch Plugin for JetBrains IDEs
https://plugins.jetbrains.com/plugin/14512-elasticsearch
59 stars 8 forks source link

Freeze when trying to connect to unreachable server #1

Closed SosthenG closed 4 years ago

SosthenG commented 4 years ago

Hey, thanks for this nice plugin I've just discovered!

I added two ES servers : dev (local) and prod (which is only accessible if I connect to a VPN). When I'm disconnected from the VPN, I can't access the prod server and I expected the plugin to just don't connect to it and let me access the dev server. Instead, my IDE just freezed has it looked to keep trying to reach the server. I didn't wait long and just killed it.

I suggest you add a short timeout or even better, try to connect to the server only if the user unfold it in the list (it looks like it's the behaviour of the database tab of Idea but I might be wrong). I think it would be the best because I've noticed that opening the tab is quite long as the plugin seems to get infos on all the added servers but I don't think it's really necessary unless we explicitly click on them. Please tell me what you think about it, it might be useful for you or others...

Thanks!

AntonShuvaev commented 4 years ago

Hi @SosthenG , thanks for reporting!

Getting cluster info was running in UI thread by mistake. It caused freezing. I fixed it and also reduced a connection establishment timeout to 5 seconds.

Regarding your suggestion to connect to the server only if the user unfolds it, I agree with that and planning to fix this soon.

SosthenG commented 4 years ago

Hi @AntonShuvaev ! Thanks for the really quick fix, I will try again after your release!