podman-desktop icon indicating copy to clipboard operation
podman-desktop copied to clipboard

extension may stuck in `activating` state if dispose are never ending

Open axel7083 opened this issue 1 year ago • 3 comments

Bug description

Reading carefully the logs in https://github.com/containers/podman-desktop/issues/9370#issuecomment-2419499871 we have the following

Activating extension podman-desktop.podman failed error:Error: Extension podman-desktop.podman activation timed out after 20 seconds

which correspond to the following console.log

https://github.com/containers/podman-desktop/blob/6c8c434fa61f175288c33e9b0ae043119166783a/packages/main/src/plugin/extension-loader.ts#L1639

However; a per the user state: we never the extension state to failed, still on activate, meaning something went wrong in those lines

https://github.com/containers/podman-desktop/blob/6c8c434fa61f175288c33e9b0ae043119166783a/packages/main/src/plugin/extension-loader.ts#L1639-L1650

We are iterating in the subscriptions, and disposing them in a try catch, but here is the catch... we do not set timeout to them, but... they are not promises, they should not take too much time ??

Podman is adding tons of disposales, some of them very heavy

https://github.com/containers/podman-desktop/blob/d11a6f91b4f950430d11a6cfe6b29d1cad42dc64/extensions/podman/packages/extension/src/extension.ts#L1561-L1563

Operating system

Windows 11

Installation Method

Other

Version

next (development version)

Steps to reproduce

https://github.com/containers/podman-desktop/issues/9370

Relevant log output

No response

Additional context

No response

axel7083 avatar Oct 17 '24 14:10 axel7083

If the problem is coming from disposal never ending, this is tricky, and bad. But we could work around by appliying a race condition between a setTimeout and the disposals, or moving the setState error above, but we could have a state where some resources are yet not disposed, and the extension may restarted.

IMO the timeout race is an acceptable solution :/

axel7083 avatar Oct 17 '24 14:10 axel7083

I have a reproducer:

  • have 2 podman machine started
  • start podman desktop
  • the podman extension will display a dialog about the podman default connection not in sync with the podman machine
  • wait at least 20 seconds to answer to the dialog --> extension start elapsed

jeffmaury avatar Oct 17 '24 14:10 jeffmaury

I have a reproducer:

* have 2 podman machine started

* start podman desktop

* the podman extension will display a dialog about the podman default connection not in sync with the podman machine

* wait at least 20 seconds to answer to the dialog --> extension start elapsed

Moreover, in this state extension cannot be activated anymore in running Podman Desktop. The error says:

Activating extension podman-desktop.podman failed error:Error: command 'podman.onboarding.checkInstalledCommand' already exists

odockal avatar Oct 17 '24 16:10 odockal

closing as activate method of podman extension has been changed.

(in any case the issue comes from the extension)

benoitf avatar Dec 04 '24 18:12 benoitf