Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

OS-level notifications for all local instances when upgrading a single instance to a new version #1054

Open
raddevon opened this issue May 25, 2023 · 16 comments · Fixed by #1058

Comments

@raddevon
Copy link
Contributor

raddevon commented May 25, 2023

When upgrading a local instance to a new server version, I get one OS-level notification that a background item has been added for each instance running on my system. I would expect to get only one for the newly upgraded instance.

Update: I've just noticed that I also get these notifications after restarting my system. I do not get any notifications for other background services, but I get one per EdgeDB instance upon restart. Added this as an alternative reproduction.

image

  • EdgeDB Version: 3.0-rc.1+23c3462
  • EdgeDB CLI Version: EdgeDB CLI 3.1.0-dev.994+eb21ca5
  • OS Version: macOS 13.3.1

Steps to Reproduce:

  1. With other instances on the system, upgrade an existing instance to a new version
  2. Observe notifications

or

  1. With instances on the system, restart the computer
  2. Observe notifications
@raddevon
Copy link
Contributor Author

This is really strange. I just launched UTM (a macOS GUI for QEMU), and I got the same thing — notifications for all of my EdgeDB instances. 🤔

Just closed it and re-launched it, and I didn't get the notifications. Seems it was only on initial launch of UTM.

@tailhook
Copy link
Contributor

tailhook commented May 29, 2023

I don't see any code that touches other services on upgrade. So probably this is some MacOS bug that shows notifications of all services when one is changed, as confirmed by UTM launch.

Can you also try upgrading an instance after UTM is installed and look whether UTM is also shown in notifications? (i.e. confirm that this is not EdgeDB-specific issue).

@raddevon
Copy link
Contributor Author

raddevon commented May 30, 2023

I have only ever seen these "off-topic" notifications referencing the edgedb service although I have quite a few other background services running. Here's a partial list of some non-edgedb services I run:
CleanShot 2023-05-30 at 07 19 27@2x

I run close to a dozen non-edgedb services, and I've only ever seen notifications referencing those when installing the associated apps.

tailhook added a commit that referenced this issue May 31, 2023
This should suppress unintended notifications by MacOS.

Fixes #1054
@tailhook
Copy link
Contributor

Looks like #1058 should fix it. Would you mind testing it git version? We do rewrite .plist files on stop/start currently. So to test it you can stop and then start your instances (each of them separately, or just some of them to see that there are less notifications). And then do whatever was triggering this notification (i.e. the upgrade of some instance).

@raddevon
Copy link
Contributor Author

I don't mind testing it. How would I do that? I'm not sure how to run the CLI out of a particular branch.

@tailhook
Copy link
Contributor

tailhook commented Jun 1, 2023

If you have Rust installed run in the edgedb-cli repository:

git fetch
git checkout suppress_bg
cargo run -- instance stop -I <inst_name>
cargo run -- instance start -I <inst_name>
cargo run -- instance upgrade --force -I <other_inst_name>

You may also run cargo run --release -- <cli args> to make CLI run faster (at the expense of the slower build).

elprans pushed a commit that referenced this issue Jun 1, 2023
This should suppress unintended notifications by MacOS.

Fixes #1054
elprans pushed a commit that referenced this issue Jun 1, 2023
This should suppress unintended notifications by MacOS.

Fixes #1054
@raddevon
Copy link
Contributor Author

raddevon commented Jun 2, 2023

This looks great, @tailhook! When I upgraded the instance, I got only the single notification. 🎉

@raddevon
Copy link
Contributor Author

raddevon commented Jun 5, 2023

It appears this didn't fix the issue after all, @tailhook (or else there has been a regression). This morning, I upgraded the CLI and created a new instance. Got a notification for each instance on my machine again.

@raddevon raddevon reopened this Jun 5, 2023
@tailhook
Copy link
Contributor

tailhook commented Jun 5, 2023

Did you upgrade to the nightly? I think we didn't make a stable release.

@raddevon
Copy link
Contributor Author

raddevon commented Jun 5, 2023

I'm on 3.2.0-dev.1003+c9675ed

@elprans
Copy link
Member

elprans commented Jun 5, 2023

That might be because this fix only applies to newly created instances, i.e. it does not retroactively apply to all existing service units. IIRC we regenerate unit files on a stop/start cycle, so @raddevon, please try doing that to your old instances and see if the issue persists or not.

@raddevon
Copy link
Contributor Author

raddevon commented Jun 5, 2023

OK, so I would stop/start all of my instances to regenerate all unit files, upgrade the CLI again, and create a new instance? Am I understanding correctly, @elprans?

@raddevon
Copy link
Contributor Author

It seems this is also happening for instances a user has already destroyed according to a Discord user. See the thread attached to this message: https://discord.com/channels/841451783728529451/849377751370432573/1119215483183452180

@tailhook
Copy link
Contributor

Hm, non-removing service files is weird indeed. Can you try destroying the instance with logging enabled?

RUST_LOG=info edgedb instance destroy -I name

Otherwise, I'll try reproduce it on monday.

@tailhook
Copy link
Contributor

I can't reproduce it myself. Service files are removed as expected on my MacOS 11.2.

@mmastrac
Copy link
Contributor

For those seeing the issue, does running sfltool resetbtm from the terminal help? There was an issue with launch agents in Ventura (https://discussions.apple.com/thread/254341579?sortBy=rank) that occasionally shows up with this symptom.

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

Successfully merging a pull request may close this issue.

4 participants