Shooter7119 / sequel-pro

Automatically exported from code.google.com/p/sequel-pro
Other
0 stars 0 forks source link

Cannot save session if database connection goes down #1016

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open Sequel Pro, preferably with multiple tabs that point to multiple 
databases
2. Write queries to the Query editor into the different tabs
3. Take down one of the databases
4. Due to the modal sheet design, user cannot do anything except close the 
connection, losing the Query Editor contents. Also, other tabs are unavailable 
until the single problematic connection is closed. SQP also tends to crash very 
easily, if the editor is left in this state.

What is the expected output? What do you see instead?

I'd expect SQP to allow me to save the session and/or copy pate the query 
editor contents to safety, even if a DB goes down. Instead, I'm forced to lose 
the Query Editor contents, unless I can bring up the database quickly, or 
remove the cause that makes me unable to connect (which surprisingly often is 
impossible to achieve).

What version of Sequel Pro are you using? What version of MySQL are you
connecting to on the server?

Latest SQP build that was available. Several different MySQL versions.

Please provide any additional information below.

The editor is lovely, except when anything out of the ordinary happens, at 
which point I tend to always lose all the query editor contents due to the 
modal design of the editor, or a crash.

Original issue reported on code.google.com by sulka.h...@gmail.com on 24 Mar 2011 at 12:27

GoogleCodeExporter commented 9 years ago
Hi Sulka!

There's a few issues here, definitely.

Firstly, the connection lost sheet currently has to be application-modal, as it 
might pop up during queries - which need to be automatically resumed/retried if 
the user opts to (successfully) reconnect.  If the whole application was 
designed to run queries using callbacks this wouldn't be so much of an issue, 
but historically the entire thing wasn't threaded so unbreaking this will take 
some time.

Secondly, window sheets do currently block access to other tabs in the window, 
even if they're not app modal. this is because sheets at an OS level are 
window-specific, and we can't easily change that to be tab-specific - we may 
have to roll our own sheet replacements to tackle this one :/

Thirdly, losing the query editor contents… do you currently use connection 
files (.spf or .spfs), or the favourites list?  We should definitely save for 
the former but I'm not sure that's happening yet.

Fourthly, the crash on disconnection.  The MySQL libraries and overfreeing of 
data are ultimately the cause for this - I get the feeling they're not really 
designed for long-running use in client applications, particularly under 
difficult network conditions - not normally a script/server situation!  I think 
we're already pulling out all the information we can here in order to clean up 
correctly; the next steps might be to avoid cleaning up in problematic 
situations (!) or to work with the MySQL guys to see if the state can be more 
consistent…

So all in all a very messy situation but we should definitely be able to 
improve it.

PS: I was going to come along this Saturday but I'm out of the country… have 
a great time :)

Original comment by rowanb@gmail.com on 24 Mar 2011 at 1:02

GoogleCodeExporter commented 9 years ago
>Thirdly, losing the query editor contents… do you currently use connection 
files (.spf or .spfs), or the favourites >list?  We should definitely save for 
the former but I'm not sure that's happening yet.

Both. For new analyses, I start with a Favorite, and then proceed to having a 
analysis specific "workspace" that I want to save to a session file. Having the 
connection break often causes some critical change to a query to disappear. I'd 
love being able to save the .spfs file.

(Also please allow the use of Save As..., which seems to have disappeared from 
the interface. Possibly as a side result of this, I've managed to overwrite a 
session file with a blank file couple times.)

Original comment by sulka.h...@gmail.com on 24 Mar 2011 at 2:13

GoogleCodeExporter commented 9 years ago
Quick answer to that one: the File menu was getting rather long, so we made 
more use of menu item groupings.  If you hold down Shift and/or Option (Alt) 
with the File menu open, you should see the various Save As… options reappear.

Original comment by rowanb@gmail.com on 24 Mar 2011 at 2:22

GoogleCodeExporter commented 9 years ago
Found another case in which I can't save a session but would like to: MySQL has 
some bug where a killed query might never return, so SQP thinks the query is 
running forever. These type of queries prevent a session from being saved, as 
running a query prevents session saving.

Original comment by sulka.h...@gmail.com on 28 Mar 2011 at 9:39