Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Application launch stdout/stderr in GUI build #1684

Merged
merged 6 commits into from
Jul 26, 2021

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Jun 10, 2021

Issue

Since in built openpype_gui executable is sys.stdout and sys.stderr set to None application launched using subprocess.Popen may get blocking handler for output which can cause crash in specific situations. It's small probability and in most of cases it will crash silently but there are cases when this cause unexpected crash of whole application (happened once to me). Most of applications do not rely on stdout set on launch, like maya, But some of them do, like nuke or non python hosts using openpype itself.

How to replicate

  • I've run a lot processes of applications and triggered threaded prints and logs (publishing)

Changes

  • set stdout/stderr of child process to DEVNULL on application launch if sys.stdout is None
  • Foundry apps on windows
    • they are not launched using CMD.exe but using CREATE_NEW_CONSOLE flag
    • in their cases is stdout/stderr not redirected to DEVNULL because new console would not have output

How to test

  • all applications should work when launched using openpype_gui executable and from code
  • change may affect mainly Foundry apps and Nonpython hosts
  • test applications launch Launcher + Ftrack action
    • Nuke
      • Windows
      • Linux
      • MacOs
    • Photoshop/Aftereffects
      • Windows
      • MacOs
    • Tvpaint
      • Windows
    • Harmony
      • Windows
      • MacOs
    • Blender
      • Windows
      • Linux
      • MacOs
    • Maya
      • Windows
      • Linux
      • MacOs

Depends on ynput/avalon-core#354

@iLLiCiTiT iLLiCiTiT marked this pull request as ready for review June 11, 2021 14:58
@iLLiCiTiT iLLiCiTiT self-assigned this Jun 11, 2021
@iLLiCiTiT iLLiCiTiT added backend type: bug Something isn't working labels Jun 11, 2021
@kalisp
Copy link
Member

kalisp commented Jun 14, 2021

Tested PS/AE on Windows, works

Copy link
Member

@jakubjezek001 jakubjezek001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please merge actual develop before the merge, thank you.

@64qam
Copy link
Member

64qam commented Jul 23, 2021

To running Adobe things and Harmony on Mac this is needed ynput/avalon-core#354

@iLLiCiTiT iLLiCiTiT merged commit f320750 into develop Jul 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants