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

fix: remove ReadLine from console app when not polling #677

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DinoChiesa
Copy link

the Console app performs a ReadLine before exiting.
When run headless, with no polling, it may never exit, waiting forever.

This PR removes the ReadLine.

@DinoChiesa
Copy link
Author

@philosowaffle WDYT?

@DinoChiesa
Copy link
Author

@philosowaffle - the ReadLine in the finally block prevents an unattended "single run" of the console app. The app never exists, waiting for that user input. Can you remove this?

@philosowaffle
Copy link
Owner

I know it seems like a trivial ask, but I'm trying to think through:

  1. why this isn't an issue for the people using the Github Action (example) which also qualifies as an unattended single run? It looks like it ought to be a problem there too, but to my knowledge its not.
  2. The history of when this used to be configurable to see if there's value in going back to that. IIRC originally, if an error happened, the console would exit immediately and no one could see what the actual error was. This was back when most of the non-technical users were launching P2G console as an exe program. The read line gave them an opportunity to copy/paste the output for a bug report here. But this use case may no longer be valid with the introduction of P2G UI.
  3. would this be a breaking change for any existing setups out there? Probably not, GHA is likely the main use case that needs to be tested and confirmed to still work, especially if we can't explain why it works right now.

@DinoChiesa
Copy link
Author

I know it seems like a trivial ask, but I'm trying to think through:

It's good to be thoughtful about changes!

I don't have any good ideas for why GHA wouldn't have this problem. Maybe Github Actions sets up the container for this app differently than the setup the app gets running within Cloud Run. Maybe the .ReadLine() within GHA detects that there is nothing to read and it returns quickly, while the same call made when p2g_console is running within Cloud Run, does not detect that there is nothing to read and it waits indefinitely. Sounds plausible but I have no data.

If it were not too much trouble, maybe add a new setting, somewhere in the configuration.local.json that, when true, tells p2g_console to not call .ReadLine ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants