GoogleCloudPlatform / google-cloud-eclipse

Google Cloud Platform plugin for Eclipse
Apache License 2.0
86 stars 49 forks source link

Uninstalling App Engine facet and Dynamic Web facet together doesn't remove App Engine Standard Runtime library #1160

Open chanseokoh opened 7 years ago

chanseokoh commented 7 years ago

The App Engine Standard Runtime library (servlet and jsp jars) remains in the build path.

selection_005

On the other hand, when uninstalling the App Engine facet alone, the library is removed as expected.

chanseokoh commented 7 years ago

Changed title: does remove --> doesn't remove

chanseokoh commented 7 years ago

Looks like the library is removed properly only when the Dynamic Web facet is present. We are removing the App Engine runtime by scheduling a job that tends to run after the Dynamic Web facet is removed, so this is why the library is not removed.

chanseokoh commented 7 years ago

We can't make this work, because when you select multiple facets and uninstall them, they are done in a batch (FacetedProject.modifyInternal() loops over Actions) while holding a lock (via ProjectFacet.beginModification()). That is, there is no room for FacetedProject.removeTargetedRuntime() (which attempts to grab a lock) to be called between removing the App Engine facet and the Dynamic Web facet.

We may have to add code to explicitly remove the library (if it's still there), rather than relying on WTP to remove it when detaching the App Engine runtime. But I'd say this issue is a low priority.