Skip to content

Conversation

@ccordoba12
Copy link
Member

@ccordoba12 ccordoba12 commented Sep 29, 2025

Right now we're using pgrep spyder to check if Spyder is still running before starting the update.

However, that matches the command used to run the updater on Linux, which in my case is:

/home/carlos/.local/spyder-6/envs/spyder-updater/bin/python3.13 /home/carlos/.local/spyder-6/envs/spyder-updater/bin/spyder-updater --update-info-file /tmp/spyder-carlos/updates/6.1.0rc1/update-info.json --start-spyder

And that makes the updater wait indefinitely for itself to be closed.

So, if we use pgrep spyder-runtime, we shouldn't have this problem.

@ccordoba12 ccordoba12 requested a review from mrclary September 29, 2025 22:23
@ccordoba12 ccordoba12 self-assigned this Sep 29, 2025
@ccordoba12 ccordoba12 added the bug Something isn't working label Sep 29, 2025
@mrclary
Copy link
Collaborator

mrclary commented Sep 29, 2025

Hmm... on macOS pgrep spyder-runtime does not return anything, while pgrep spyder returns the Spyder process. Interestingly, ps -ef | grep spyder-runtime and ps -ef | grep spyder return the same results.

@ccordoba12
Copy link
Member Author

Perhaps we should use then pgrep spyder-runtime for Linux and pgrep spyder for Mac?

@mrclary
Copy link
Collaborator

mrclary commented Sep 30, 2025

Perhaps we should use then pgrep spyder-runtime for Linux and pgrep spyder for Mac?

Okay, I think we can just use -f for both Linux and macOS. That is supposed to match against the full command, not just the process name. Can you confirm on linux?

pgrep -f spyder-runtime

and

pgrep -f spyder-updater


wait_for_spyder_quit(){
while [[ $(pgrep spyder 2> /dev/null) ]]; do
while [[ $(pgrep spyder-runtime 2> /dev/null) ]]; do
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
while [[ $(pgrep spyder-runtime 2> /dev/null) ]]; do
while [[ $(pgrep -f spyder-runtime 2> /dev/null) ]]; do

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think if we add the -f flag, then it will search the entire command instead of just the process name, so it should work for both macOS and Linux. This seemed to work for me on macOS; I could isolate and distinguish between Spyder and Spyder updater.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, this fails for me on Linux (i.e. I get the same behavior as with pgrep spyder).

Copy link
Member Author

Choose a reason for hiding this comment

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

However, this works, which I think it's better

Suggested change
while [[ $(pgrep spyder-runtime 2> /dev/null) ]]; do
while [[ $(pgrep -f spyder-runtime/bin 2> /dev/null) ]]; do

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's interesting; I wonder why /bin works but sans /bin does not? Anyway, this appears to work on macOS as well, so it should be good.

@ccordoba12 ccordoba12 merged commit 105d420 into spyder-ide:main Sep 30, 2025
1 check passed
@ccordoba12 ccordoba12 deleted the fix-spyder-quit branch September 30, 2025 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants