Boring Connection reset. #202

Closed
JayMiao opened this Issue Nov 17, 2015 · 14 comments

Comments

Projects
None yet
4 participants
@JayMiao

JayMiao commented Nov 17, 2015

Again, me :)

vipcenter> select * from member;
Connection reset. Reconnect (Y/n): Y
Reconnected!
Try the command again.

Why my connection is always be reset, should I change some mysql setting?

@amjith

This comment has been minimized.

Show comment
Hide comment
@amjith

amjith Nov 17, 2015

Member

We currently use a timeout of 1024 seconds. It is the standard timeout used for interactive sessions.

Can you tell me how long does the REPL sit idle before you reach this timeout?

Member

amjith commented Nov 17, 2015

We currently use a timeout of 1024 seconds. It is the standard timeout used for interactive sessions.

Can you tell me how long does the REPL sit idle before you reach this timeout?

@JayMiao

This comment has been minimized.

Show comment
Hide comment
@JayMiao

JayMiao Nov 17, 2015

It depends, but I'm sure it is less than 1024. 

I was thinking if the mycli get the colum name or table name using background quick searching to the MySQL. Then the connection will be reset ? Just an assumption. 


Sent from Mailbox

On Wed, Nov 18, 2015 at 1:31 AM, Amjith Ramanujam
notifications@github.com wrote:

We currently use a timeout of 1024 seconds. It is the standard timeout used for interactive sessions.

Can you tell me how long does the REPL sit idle before you reach this timeout?

Reply to this email directly or view it on GitHub:
#202 (comment)

JayMiao commented Nov 17, 2015

It depends, but I'm sure it is less than 1024. 

I was thinking if the mycli get the colum name or table name using background quick searching to the MySQL. Then the connection will be reset ? Just an assumption. 


Sent from Mailbox

On Wed, Nov 18, 2015 at 1:31 AM, Amjith Ramanujam
notifications@github.com wrote:

We currently use a timeout of 1024 seconds. It is the standard timeout used for interactive sessions.

Can you tell me how long does the REPL sit idle before you reach this timeout?

Reply to this email directly or view it on GitHub:
#202 (comment)

@amjith

This comment has been minimized.

Show comment
Hide comment
@amjith

amjith Nov 17, 2015

Member

I don't fully understand your question but if you're asking whether mycli gets the column name or table names in a background thread, then the answer is it depends on your mycli version. Starting from mycli version 1.5.0 and above they are fetched in a background thread. But before that it was done synchronously in the foreground.

So if you're using an older version, my recommendation is to upgrade to 1.5.0 or above.

Member

amjith commented Nov 17, 2015

I don't fully understand your question but if you're asking whether mycli gets the column name or table names in a background thread, then the answer is it depends on your mycli version. Starting from mycli version 1.5.0 and above they are fetched in a background thread. But before that it was done synchronously in the foreground.

So if you're using an older version, my recommendation is to upgrade to 1.5.0 or above.

@JayMiao

This comment has been minimized.

Show comment
Hide comment
@JayMiao

JayMiao Nov 30, 2015

When I update to 1.5.0. It seems not improve.
Connection reset. Reconnect (Y/n): Y
Reconnected!
Try the command again.

Is there a setting that the mycli can auto-reconnect when connection broken?

JayMiao commented Nov 30, 2015

When I update to 1.5.0. It seems not improve.
Connection reset. Reconnect (Y/n): Y
Reconnected!
Try the command again.

Is there a setting that the mycli can auto-reconnect when connection broken?

@blackakula

This comment has been minimized.

Show comment
Hide comment
@blackakula

blackakula Nov 30, 2015

+1
I'm ok with reconnect confirmation. But is it possible to make automatic re-query last command? Native mysql cmd client does this way. Maybe it's possible to add one more config setting to re-query last command on reconnect? It's really boring to recall last command once again.
And it would be also helpful to setup confirmations in different cases with the config settings.

+1
I'm ok with reconnect confirmation. But is it possible to make automatic re-query last command? Native mysql cmd client does this way. Maybe it's possible to add one more config setting to re-query last command on reconnect? It's really boring to recall last command once again.
And it would be also helpful to setup confirmations in different cases with the config settings.

@amjith

This comment has been minimized.

Show comment
Hide comment
@amjith

amjith Nov 30, 2015

Member

@blackakula Can you tell me how often this happens? I'm surprised that I haven't run into this myself.

The reason for asking you to manually rerun the last command is a safety feature. I'm reluctant to override that with a config value. But if it happens often enough I'll definitely consider it.

What other cases do you want confirmation? Can you please elaborate?

Member

amjith commented Nov 30, 2015

@blackakula Can you tell me how often this happens? I'm surprised that I haven't run into this myself.

The reason for asking you to manually rerun the last command is a safety feature. I'm reluctant to override that with a config value. But if it happens often enough I'll definitely consider it.

What other cases do you want confirmation? Can you please elaborate?

@blackakula

This comment has been minimized.

Show comment
Hide comment
@blackakula

blackakula Nov 30, 2015

Hi @amjith

how often this happens?

Usually at the beginning of each day (I left my computer on when leaving office). And sometimes during the day. But I never noticed if it less or not than 1024 seconds. On native mysql cli it was not disturbing me, because mysql native client automatically re-connect and repeat the last query without any confirmation.

What other cases do you want confirmation? Can you please elaborate?

mycli also require confirmation on drop tables, columns. I appreciate such confirmations, but it would be better to have it configurable (at least to achieve the same behavior as a native mysql cli client).

Hi @amjith

how often this happens?

Usually at the beginning of each day (I left my computer on when leaving office). And sometimes during the day. But I never noticed if it less or not than 1024 seconds. On native mysql cli it was not disturbing me, because mysql native client automatically re-connect and repeat the last query without any confirmation.

What other cases do you want confirmation? Can you please elaborate?

mycli also require confirmation on drop tables, columns. I appreciate such confirmations, but it would be better to have it configurable (at least to achieve the same behavior as a native mysql cli client).

@amjith

This comment has been minimized.

Show comment
Hide comment
@amjith

amjith Nov 30, 2015

Member

mycli also require confirmation on drop tables, columns. I appreciate such confirmations, but it would be better to have it configurable (at least to achieve the same behavior as a native mysql cli client).

This is configurable. You can open up the config file located at ~/.myclirc and set

destructive_warning = False
Member

amjith commented Nov 30, 2015

mycli also require confirmation on drop tables, columns. I appreciate such confirmations, but it would be better to have it configurable (at least to achieve the same behavior as a native mysql cli client).

This is configurable. You can open up the config file located at ~/.myclirc and set

destructive_warning = False
@amjith

This comment has been minimized.

Show comment
Hide comment
@amjith

amjith Nov 30, 2015

Member

I'll consider adding a config value to reconnect automatically.

Member

amjith commented Nov 30, 2015

I'll consider adding a config value to reconnect automatically.

@JayMiao

This comment has been minimized.

Show comment
Hide comment
@JayMiao

JayMiao Nov 30, 2015

Yep, the perfect mycli is just let me run the query I input and put the reconnect things background.
Possible When I turn on the auto-reconnect setting, every time execute SQL check the connection and if it's broken just connect background and run my SQL immediately.

"destructive_warning" is necessary !!!

JayMiao commented Nov 30, 2015

Yep, the perfect mycli is just let me run the query I input and put the reconnect things background.
Possible When I turn on the auto-reconnect setting, every time execute SQL check the connection and if it's broken just connect background and run my SQL immediately.

"destructive_warning" is necessary !!!

@diversario

This comment has been minimized.

Show comment
Hide comment
@diversario

diversario Feb 16, 2016

Yep, I'm so tired of the "Connection reset" message. It's happening almost every single time I get back to the CLI. I would really, really love some setting that makes it never show again and just do the reconnect for me and run my query.

Yep, I'm so tired of the "Connection reset" message. It's happening almost every single time I get back to the CLI. I would really, really love some setting that makes it never show again and just do the reconnect for me and run my query.

@diversario

This comment has been minimized.

Show comment
Hide comment
@diversario

diversario Aug 29, 2016

To illustrate, this is what I see a lot:

mariadb db> delete from foo;
You're about to run a destructive command.
Do you want to proceed? (y/n): y
Your call!
Connection reset. Reconnect (Y/n): y
Reconnected!
Try the command again.
mariadb db> delete from foo;
You're about to run a destructive command.
Do you want to proceed? (y/n): y
Your call!
Query OK, 1 row affected
Time: 0.247s
mariadb db>

6 keyboard strokes to execute what should've taken 2. It may not seem like a big deal but when you're in the middle of something this is a completely unnecessary distraction.

diversario commented Aug 29, 2016

To illustrate, this is what I see a lot:

mariadb db> delete from foo;
You're about to run a destructive command.
Do you want to proceed? (y/n): y
Your call!
Connection reset. Reconnect (Y/n): y
Reconnected!
Try the command again.
mariadb db> delete from foo;
You're about to run a destructive command.
Do you want to proceed? (y/n): y
Your call!
Query OK, 1 row affected
Time: 0.247s
mariadb db>

6 keyboard strokes to execute what should've taken 2. It may not seem like a big deal but when you're in the middle of something this is a completely unnecessary distraction.

@amjith

This comment has been minimized.

Show comment
Hide comment
@amjith

amjith Aug 29, 2016

Member

That is definitely annoying. I'll see if I can fix that.

BTW, you can turn off the warning on destructive commands via the config file (~/.myclirc).

https://github.com/dbcli/mycli/blob/master/mycli/myclirc#L17

Member

amjith commented Aug 29, 2016

That is definitely annoying. I'll see if I can fix that.

BTW, you can turn off the warning on destructive commands via the config file (~/.myclirc).

https://github.com/dbcli/mycli/blob/master/mycli/myclirc#L17

@diversario

This comment has been minimized.

Show comment
Hide comment
@diversario

diversario Aug 29, 2016

Yeah, I know. I'm ok with the warning, though, no harm is being extra-cautious with the db.

Yeah, I know. I'm ok with the warning, though, no harm is being extra-cautious with the db.

jialongl pushed a commit to jialongl/mycli that referenced this issue Dec 15, 2016

jialongl pushed a commit to jialongl/mycli that referenced this issue Dec 15, 2016

@amjith amjith closed this in 05a13b7 Dec 22, 2016

amjith added a commit that referenced this issue Dec 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment