pgcli
pgcli copied to clipboard
Can not quit pgcli if server has shutdown
Description
Unable to quite pgcli if the server has shutdown. I can't seem to exit if I have a running pgcli against a server that has shutdown after I opened the connection.
Your environment
- [ ] Mac OS Sonoma
- [ ] pgcli 4.0.1
- [ ] What is the output of
pip freezecommand.
altgraph @ file:///AppleInternal/Library/BuildRoots/9dd5efe2-7fad-11ee-b588-aa530c46a9ea/Library/Caches/com.apple.xbs/Sources/python3/altgraph-0.17.2-py2.py3-none-any.whl
argcomplete==3.1.6
boto3==1.28.10
botocore==1.31.10
cffi==1.15.1
cryptography==41.0.1
distlib==0.3.7
filelock==3.13.1
future @ file:///AppleInternal/Library/BuildRoots/9dd5efe2-7fad-11ee-b588-aa530c46a9ea/Library/Caches/com.apple.xbs/Sources/python3/future-0.18.2-py3-none-any.whl
Jinja2==3.1.2
jmespath==1.0.1
macholib @ file:///AppleInternal/Library/BuildRoots/9dd5efe2-7fad-11ee-b588-aa530c46a9ea/Library/Caches/com.apple.xbs/Sources/python3/macholib-1.15.2-py2.py3-none-any.whl
MarkupSafe==2.1.3
pathspec==0.11.2
platformdirs==4.1.0
pycparser==2.21
pyOpenSSL==23.2.0
python-dateutil==2.8.2
PyYAML==6.0.1
s3transfer==0.6.1
six @ file:///AppleInternal/Library/BuildRoots/9dd5efe2-7fad-11ee-b588-aa530c46a9ea/Library/Caches/com.apple.xbs/Sources/python3/six-1.15.0-py2.py3-none-any.whl
tomlkit==0.12.3
urllib3==1.26.16
virtualenv==20.25.0
xmltodict==0.13.0
yamllint==1.33.0
yq==3.2.3
Looks like this bug happens even when there are any kinds of network errors. Why do we need a connection to quit?
I'm connecting to a database behind a VPN, so this one time I allowed VPN to expire, losing the connection. So I stepped in this bug:
sync> select count(*) from segments;
consuming input failed: could not receive data from server: Can't assign requested address
SSL SYSCALL error: Can't assign requested address
Time: 55.661s (55 seconds), executed in: 55.660s (55 seconds)
sync> select count(*) from segments;
sending query failed: could not receive data from server: Can't assign requested address
SSL SYSCALL error: Can't assign requested address
another command is already in progress
Time: 0.002s
sync> select count(*) from segments;
sending query failed: could not receive data from server: Can't assign requested address
SSL SYSCALL error: Can't assign requested address
another command is already in progress
another command is already in progress
Time: 0.002s
sync> \q
A transaction is ongoing. Choose `c` to COMMIT, `r` to ROLLBACK, `a` to abort exit. [a]: ^[[A
A transaction is ongoing. Choose `c` to COMMIT, `r` to ROLLBACK, `a` to abort exit. [a]: r
sending query failed: could not receive data from server: Can't assign requested address
SSL SYSCALL error: Can't assign requested address
another command is already in progress
another command is already in progress
another command is already in progress
Time: 0.006s
sync> select count(*) from segments;
sending query failed: could not receive data from server: Can't assign requested address
SSL SYSCALL error: Can't assign requested address
another command is already in progress
another command is already in progress
another command is already in progress
another command is already in progress
Time: 0.001s
sync> \q
A transaction is ongoing. Choose `c` to COMMIT, `r` to ROLLBACK, `a` to abort exit. [a]: r
sending query failed: could not receive data from server: Can't assign requested address
SSL SYSCALL error: Can't assign requested address
another command is already in progress
another command is already in progress
another command is already in progress
another command is already in progress
another command is already in progress
Time: 0.003s
sync> \q
A transaction is ongoing. Choose `c` to COMMIT, `r` to ROLLBACK, `a` to abort exit. [a]: r
sending query failed: could not receive data from server: Can't assign requested address
SSL SYSCALL error: Can't assign requested address
another command is already in progress
another command is already in progress
another command is already in progress
another command is already in progress
another command is already in progress
another command is already in progress
Time: 0.002s
All three options(c, r, a) lead to the same result.