-
Notifications
You must be signed in to change notification settings - Fork 124
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
Programs using api.connect hang unless api.shutdown is explicitly called before exit #288
Comments
The Twisted reactor is not restartable! A reactor is only started by the API when no-one is yet running. Stopping it after FYI: Twisted is |
* test: keys are released in reverse order Since: a4bb988 * ci: Add Python 3.12 as supported * ci: Quote shell variables * ci: Move vncdo from /tmp/ to $PWD/.vncdo Hard-coded paths below /tmp/ are a security issue on shared hosts. /tmp/ is (often) cleaned up on reboot. * doc: Fix building documentation * doc: Improve documentation Fix spelling errors. Fix broken links, e.g. https:// everywhere. Fix Sphinx reST markup. * doc: Document API shutdown Issue #288 * refactor: modernize type annotations pyupgrade --py38-plus ruff check --fix setup.py vncdotool/*.py * fix: mouseDrag diagonally move mouse diagonally instead of first going up/down and then left/right. Do not use `time.sleep()` with Twisted reactor as it will also pause all other event processing. Patch `vncev` to print all mouse events, including those where not button is pressed / released. Issue #287 * fixup! ci: Add Python 3.12 as supported * fixup! doc: Improve documentation
The problem in my understanding is whether this should be considered bug or expected behavior. Personally I would consider it a bug since a lot of previous behavior is broken and we have circumstances where it is very hard to pin down where exactly to "shutdown" but perhaps I might have misunderstood something here and this is a new behavior we are expected to adapt to. |
And since I don't have the authority to mark duplicate issues I consider this related to #255. |
What makes the issue even worse in our case is that we have multiple types of controllers only one of which relies on VNCDoTool to control a display. This need of shutting down API at least and at most once means that we cannot just place such a call in a destructor, yet we want all controller types to be interoperable and this is the first controller that demands special treatment after use and only starting from version 1.2.0 as it worked much more interoperably before. |
Please include the following information:
Client: vncdotool version: 1.2.0
Server: TigerVNC Server version 1.13.1, built Jan 30 2024 00:00:00
Run the following program:
Expected result: shuts down nicely
Actual result:
Apparently the twisted reactor created by vncdotool is marked as a background thread but it spawns workers which are not marked as background and the program does not stop. Perhaps this used to work but was broken by updates to twisted itself? I know nothing about the twisted framework.
My goals is to automate clicking through VNC inside pytest and I found that this workaround works for me:
One idea to work around the reactor not shutting down automatically would be to reference-count it from connect/disconnect.
The text was updated successfully, but these errors were encountered: