Merge lp:~sergei.glushchenko/percona-server/ST30462-bug925343-5.6 into lp:percona-server/5.6
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Stewart Smith | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 331 | ||||
Proposed branch: | lp:~sergei.glushchenko/percona-server/ST30462-bug925343-5.6 | ||||
Merge into: | lp:percona-server/5.6 | ||||
Diff against target: |
66 lines (+7/-16) 1 file modified
Percona-Server/client/mysql.cc (+7/-16) |
||||
To merge this branch: | bzr merge lp:~sergei.glushchenko/percona-server/ST30462-bug925343-5.6 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stewart Smith (community) | Approve | ||
Review via email: mp+156862@code.launchpad.net |
Description of the change
Bug 925343: mysql client aborts connection on terminal resize.
Fix for upstream bug #26780 "patch to add auto vertical output
option to the cli" introduced SIGWINCH handling by mysql cli.
This leads to EINTR to be returned by read call on socket.
On most systems there is a possibility for read call
to be automatically restarted if SA_RESTART flag is set for
the signal. Hovewer this is not the case, as read timeout on
socket has been set. Linux manual page for signal(7) tells that
there is no chance for read to be restarted if timeout has
been set on socket. It doesn't matter whether SA_RESTART has
been used for signal or not.
So the only portable solution would be to block signal for the
time when client communicates with server. This however would
require a lot of carefull code reading to spot all the point
of such communication in source code and wrap them with
block/unblock signal.
That is why option to completely disable SIGWINCH handling
has been choosen. The only purpose of SIGWINCH handler was to
determine new width of terminal window. The only place where
this width is used is to print output from the server.
Handling of SIGWINCH has been replaced with explicit invocation
of ioctl to get terminal width just before print of result set
is started.
http://