Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard shortcut for query execution should be disabled when query execution is in progress #6664

Closed
yogeshmahajan-1903 opened this issue Aug 8, 2023 · 1 comment
Assignees
Milestone

Comments

@yogeshmahajan-1903
Copy link
Contributor

yogeshmahajan-1903 commented Aug 8, 2023

Please note that security bugs or issues should be reported to security@pgadmin.org.

Describe the bug

Keyboard shortcut should be disabled when button is disabled on query tool

To Reproduce

Steps to reproduce the behavior:

  1. Go to query tool. Execute long running query and before it completes hit keyboard shortcut to execute query which triggers re-execution of query
2023-08-08 16:37:01,664: ERROR	pgadmin:	<asyncio.locks.Lock object at 0x10e010a60 [unlocked, waiters:1]> is bound to a different event loop
Traceback (most recent call last):
  File "/Users/yogeshmahajan/CodingGround/pgAdmin/DevEnv/Code/pgadmin4/web/pgadmin/utils/driver/psycopg3/cursor.py", line 281, in execute
    return asyncio.run(self._execute(query, params))
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/Users/yogeshmahajan/CodingGround/pgAdmin/DevEnv/Code/pgadmin4/web/pgadmin/utils/driver/psycopg3/cursor.py", line 292, in _execute
    return await _async_cursor.execute(self, query, params)
  File "/Users/yogeshmahajan/CodingGround/pgAdmin/DevEnv/Venv31010/lib/python3.10/site-packages/psycopg/cursor_async.py", line 89, in execute
    async with self._conn.lock:
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/locks.py", line 14, in __aenter__
    await self.acquire()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/locks.py", line 106, in acquire
    fut = self._get_loop().create_future()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/mixins.py", line 30, in _get_loop
    raise RuntimeError(f'{self!r} is bound to a different event loop')


And if you run some query again, it will give you incorrect output.

Expected behavior

Query tool execute query keyboard shortcut should be disabled while query execution is in progress.

Error message

If possible, include the full, unedited text of any error messages displayed.

Screenshots

Screenshot 2023-08-08 at 4 44 26 PM

Desktop (please complete the following information):

  • OS: [e.g. Windows 10, OSX monterey]
  • Version: [e.g. 6.15]
  • Mode: [e.g Desktop or Server]
  • Browser (if running in server mode): [e.g. chrome, safari]
  • Package type: [e.g. RPM, DEB, Python, Container, etc.]

Additional context

Add any other context about the problem here.

@yogeshmahajan-1903 yogeshmahajan-1903 self-assigned this Aug 8, 2023
@yogeshmahajan-1903 yogeshmahajan-1903 changed the title Query tool shows MaxQuqeuePool issue if keyboard shortcut keay is pressed more than 15 times. Keyboard shortcut should be disabled when button is disabled on query tool Aug 8, 2023
@yogeshmahajan-1903 yogeshmahajan-1903 changed the title Keyboard shortcut should be disabled when button is disabled on query tool Keyboard shortcut for query execution should be disabled when query execution is in progress Aug 8, 2023
yogeshmahajan-1903 added a commit to yogeshmahajan-1903/pgadmin4 that referenced this issue Aug 8, 2023
akshay-joshi pushed a commit that referenced this issue Aug 9, 2023
@akshay-joshi akshay-joshi added this to the 7.6 milestone Aug 9, 2023
@FaharAbbasRizvi FaharAbbasRizvi self-assigned this Aug 10, 2023
@FaharAbbasRizvi
Copy link
Contributor

This is fixed in the latest snapshot builds:
https://www.postgresql.org/ftp/pgadmin/pgadmin4/snapshots/2023-08-10/

akshay-joshi pushed a commit to akshay-joshi/pgadmin4 that referenced this issue Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants