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

Intermittent work / fail behavior of OCP CAD Viewer #110

Open
WayneSherman opened this issue Oct 16, 2024 · 6 comments
Open

Intermittent work / fail behavior of OCP CAD Viewer #110

WayneSherman opened this issue Oct 16, 2024 · 6 comments
Labels
bug Something isn't working cannot reproduce

Comments

@WayneSherman
Copy link

WayneSherman commented Oct 16, 2024

Using

  • a recently updated Manjaro (arch linux based)
  • tested with both python 3.12.5 and python 3.10.14
  • vscode 1.93.1
  • Installed extensions
    code --install-extension ms-python.python
    code --install-extension bernhard-42.ocp-cad-viewer # ver 2.4.1
  • Used the "Quick build123d" install button

After following the installation instructions, when opening the auto created demo file "ocp_vscode_demo.py" the viewer pane intermittently does not initialize properly.

It behaves like an initialization race condition. Changing the way I load the file changes the timing and the failure frequency, e.g. opening a folder (workspace) which contains the demo file vs opening the demo file directly. When opening a folder the viewer fails to initialize most of the time, whereas when opening the file directly the viewer pane works most of the time. But both cases have intermittent work/fail behavior.

My test system is on the slow side (running in VirtualBox) so it probably is exposing this race condition where a faster system would not see it.

Originally posted by @WayneSherman in #104

@bernhard-42
Copy link
Owner

bernhard-42 commented Oct 16, 2024

I found one problem that could be related to it. The viewer tries to respond to a resize window event and call viewer.resize when viewer is not ready initialized. Hence the viewer crashes and does not work properly any more.
On fast machines, the viewer might be initialized before the resize event hits.

The fix is to check whether viewer is not null before responding on the resize event.
But, I did not check this against a "slow system" - due to not having a slow system :-)

@bernhard-42
Copy link
Owner

bernhard-42 commented Oct 19, 2024

I've published v2.5.0 which fixes the potential race condition. Could you please test it, @WayneSherman, since I can't reproduce it

@CePeU
Copy link

CePeU commented Oct 20, 2024

I testet a fresh install (windows OS) and the hanging empty viewer window on first start remained. I will make a seperate issue in the following days.

@bernhard-42
Copy link
Owner

@CePeU Yes please, since there was no issue open I forgot to deal with it

@WayneSherman
Copy link
Author

I've published v2.5.0 which fixes the potential race condition. Could you please test it, @WayneSherman, since I can't reproduce it

Thanks for the updates. I tested v2.5.0 and the behavior is unchanged. When I "Open Folder..." with the demo file folder, most often the viewer window does not display properly. When I "Open File..." with the demo file, the viewer window usually displays correctly.

@bernhard-42 bernhard-42 added bug Something isn't working cannot reproduce labels Oct 20, 2024
@bernhard-42
Copy link
Owner

I have no idea how to reproduce this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cannot reproduce
Projects
None yet
Development

No branches or pull requests

3 participants