-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
Add retry button, subterminal, summary window to manage daemon #2708
Conversation
The overall idea of retrying an application seems ok. I'll review the contents of this probably next weekend. Shellcheck is failing due to the automatic change of ubuntu-latest moving from 22.04 to 24.04. I have already reported QEMU errors in newer QEMU that is used in 24.04 a few months back with no fix. We need to downgrade that runner back to 22.04. |
Oh I almost forgot to mention, github actions ARM64 Linux runners are now free for public repos as of earlier this week. I need to do some refactoring to move our CI actions over from the QEMU based runners to the native ARM64 runners.
Actually this part is not the cause of the shellcheck errors. Shellcheck is running natively... not sure why it is hanging. But the change from 22.04 to 24.04 is causing shellcheck to fail so I will revert that action to 22.04. |
Can't reproduce the issue on local Ubuntu Noble 24.04 shellcheck. Seems to only occur on Github Actions Ubuntu Noble 24.04. I have reported the issue here: actions/runner#3667 |
Switching shellcheck from operating on all files at once to a single file at a time reduced github actions shellcheck runtime from ~3 minutes down to ~25 seconds while also eliminating the chance of hangs observed locally 1fa28fe |
New commits change from where the terminal is launched. Now it launches from manage daemon instead of from terminal_manage_multi. |
New commits more or less render #2652 obsolete. It adds a summary window made with yad, which I think is more future-proof than 112 lines of python.
In addition to the two earlier specifics I want reviewed, @theofficialgman I would like your feedback on how I have the donation messages set up. Do you want your username/pfp/caption included in the way I have added it? Would you prefer your name not be there at all? |
Watching some apps install for the first time, that should have only been refreshed validated my concerns here. I've reverted some of those changes, returning Before this, depending on what code was handling the updates, |
Okay @theofficialgman some things have changed since my original comment. If you are only looking at this now, ignore previous comments. I only have these two things that I am requesting for you to look over:
As you can see on https://github.com/sponsors/botspot, my current real-life situation is fairly precarious, so I would like for this PR to be merged soon. |
I see nothing wrong with the way it is presented. It might be worth adding an additional row linking to all our contributors https://github.com/Botspot/pi-apps/graphs/contributors to be fair. If they have github sponsorship enabled (and some of them do) you can over over their icon and see a "sponsor" button on that page.
Noted. I'll DM you shortly (since its too personal to discuss in public imho). I don't intend on blocking your donation changes but given the nature of the other changes wrapped up in this PR I really need to do a thorough read through and regression test on our supported systems before this can be merged and I can't do that till the weekend (Saturday). |
This has bothered me ever since bookworm dropped. Now terminal appears after queueviewer window, thus, on top of it. No more half occluded terminal. This also prepares for a summary window from "Contributor update" to appear after the terminal closes.
Also, fix sourcing the other manage daemon functions like reorder_list
avoids falsely implying that I was kicked out of school
Retains retrying failed updated apps, but avoids installing all app refreshes lol.
26f6aef
to
07ffc0d
Compare
Just an FYI, I am still working through the code in my head. Mainly making sure that everything works as expected during the transition from the existing form of the scripts to this new form. I haven't actually run/tested anything new. |
There is a reason and the visual change here is a symptom of the modifications affecting runtime speed #2708 (comment) . The previous way allowed terminal-run to start as soon as possible with minimal overhead. That is why originally the terminal popped up before the manage yad window (which is why the terminal is behind the yad window). The changes you made to move the creation of the terminal-run instance much later in the process delayed the creation of the window to the point that yad started first (it is still a race condition because the yad window is a background task but it has a better chance of starting first since it was executed slightly before the terminal-run now). The problem with this is terminal-run is slow to start on some systems (because their chosen terminal takes a long time to open) and the daemon pid won't be established until the terminal-run instance has started. What you have done is actually break the pid check system entirely. Previously, the PID of the first terminal-run instance which had the daemon running was written to data/manage-daemon/pid and it is what other manage daemon calls would check to decide if they should become the daemon or only send their commands to the existing daemon. With your changes, now the updater script or gui script PID (depending on what called terminal_manage_multi) gets written to data/manage-daemon/pid, not the terminal-run instance that is actually running the daemon. |
The PID check system prevents users from launching multiple pi-apps instances and creating multiple manage daemons. There is always only one daemon. It also allows users to start updates from the onboot updates and then open pi-apps and continue to add/remove applications all using the same daemon. With the PID system broken, all that won't work anymore. |
Previously the entirety of the manage daemon ran in the terminal. I now want manage daemon to run outside of a terminal and only complete actions in the terminal, hence why I call it a "subterminal". This allows for:
I will investigate the PID issue, but the subterminal changes I want to stay. |
@theofficialgman I am confused by your statements that the PID was broken in any way.
That is line 624 I just don't see how this code path was affected in the way you describe. |
the PID is set before the manage daemon is even started now. Note that the file is written (line 624) and 30 lines later (line 643) the manage daemon is started. The PID that gets set as I said will end up being the PID of the updater or gui script not the daemon from inside terminal-run like it should be and was before when the entire manage script ran inside terminal-run. |
How exactly could $$ be the PID of gui or updater script? |
deamon pid isn't the daemon PID anymore, as I said you are running this script directly from the updater/gui, so it still has the updater/gui PID. the PID that gets written needs to be done from your new manage_daemon_terminal_code function from within the terminal-run PID, not the updater/gui script. |
That would be true if we are sourcing the manage script and running a function that contains $$. But that is not the case. So code runs like this:
Bad idea. I thought about doing that, but we want the PID to be written as early as possible to avoid race conditions or duplicate processes. |
as you can see in the above, the manage-daemon PID is not written to the PID file but instead the manage script PID run from the updater script. That is not what was done before and is wrong for the reasons stated here #2708 (comment) |
Let's hop on discord vc |
Right.... the gui calls |
@Botspot given the above, do you have any issues with merging? I am fine to merge as is. If we want to prevent scenarios like this from occurring in the future we need to re-source the api anytime it changes from when the gui was first loaded (aka: we would have to version it and check the version). |
also when you merge, I suggest squashing it. |
This is part of a larger improvement to the install/uninstall/update experience that will be ushered in with the "contributor update" #2652 PR. This PR should probably be merged first.
This adds a new Retry button as an alternative to "Send report". Hopefully users will see and use it in the event of internet issues, or when instructed to fix their system in some way, which should have these effects:
Asking for @theofficialgman to look over a couple specific changes which I think are fine, but could be problematic:
will_reinstall
which now allows returning code 0 even if the app is uninstalled. I made this change so that updated apps, successfully uninstalling but failing to install, would actually be installed rather than refreshed if the user clicks Retry.I found one usage of will_reinstall which may have new bad behavior with this change, so I replaced it with directly checking an app's installation status. This fix itself may also cause further regressions. I'm not sure.
#manage can handle this action, but avoid spawning subprocess
" comment)I vaguely remember trying to implement this once before, and there was some reason why running the "update" action was safer through a manage subprocess, but I cannot find that now nor do I see how this could cause issues.