Bug 683545 - Uploaded plugins can not be (re)deployed?
Summary: Uploaded plugins can not be (re)deployed?
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 4.0.0.B02
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: John Sanda
QA Contact: Corey Welton
URL:
Whiteboard:
Depends On:
Blocks: gwt-plugins
TreeView+ depends on / blocked
 
Reported: 2011-03-09 16:55 UTC by Corey Welton
Modified: 2011-05-24 01:16 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Corey Welton 2011-03-09 16:55:19 UTC
Description of problem:
If I try to upload a plugin, it seems to get uploaded, but not deployed.  Quite possibly there is no method in the UI to actually deploy something after it has been uploaded?

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.  Make a backup of your agent plugins
2.  Delete and purge one or more plugins (i.e., IIS, Hudson)
3.  Uupload your plugin(s) again via the upload widget.
4.  Try various things, including "Scan for Updates" to see if your plugins have been added
  
Actual results:
Nothing shows up

Expected results:
The plugins should show up...

Additional info:

...However, I am not sure all the steps for deployment are here in the UI.  I can upload any number of plugins.  Upon doing so, I see them in the upload UI -- and I can hit "Clear" to remove them from said UI. This looks like more of a "staging" area for uploading them to the server versus actual deployment.  But in this case I cannot find a method for actually getting the uploaded plugins deployed...

Comment 1 Corey Welton 2011-03-09 20:57:36 UTC
This seems to be intermittent -- though it seems to happen more reliably with the Hudson plugin, for example.

Comment 2 John Sanda 2011-03-17 20:15:46 UTC
Turns out that the problem is not plugin specific. The plugin scanner maintains a cache of plugins on the file system. That cache is updated every time the scanner runs. If you delete/purge/re-add the plugin before the scanner has run, the scanner's cache in effect becomes invalid, and it fails to detect that the plugin on the file system is new.

Comment 3 John Sanda 2011-03-17 20:27:53 UTC
Committed changes to address a problem that occurs when deleting, purging, then
re-adding the plugin. The agent plugin scanner maintains a cache of plugins on the file system, and that cache was getting dirty. This results in the scanner failing to detect a plugin that has been re-added as a new plugin, and consequently, the plugin did not get re-installed. Now when deleting a plugin, a scan is immediately triggered.
    
Then if you went yo purge right away, you could wind up with a constraint violation in rhq_resource_type. Resource types are purged in a scheduled job, so it was possible to purge and re-add a plugin before its resource types have been purged. Now the plugin is marked to be purged. The purge is done in a scheduled job and is not done until all resource types from the plugin have been purged.

Once the user sees that the plugin has been purged, he knows it is safe to re-add it

commit hash: da19c1a6b8d117e0ca04702938e5c7abce6348b6

Comment 4 John Sanda 2011-03-17 20:28:41 UTC
With the da19c1a6 commit, the UI no longer allows you to purge a plugin that you have not already deleted.

Comment 5 Mike Foley 2011-05-03 15:52:00 UTC
Tested RHQ 4.0 community release, as follows:  uploaded a test plugin (Top Server, which was attached to another bz), did 'update plugins' on the agent, then 'discovery -f', imported the resource from the auto-discovery portlet, deleted and purged the plugin.  Then repeated this a 2nd time.  RHQ 4.0 is good with plugin upload/delete/purge  ... and re-upload/delete/purge...

additionally  verified the uploads, deletes in the oracle database with this SQL

select id, name from rhq_plugin where name = 'ResourceFactoryPlugin';

Comment 6 Corey Welton 2011-05-24 01:16:29 UTC
Bookkeeping - closing bug - fixed in recent release.

Comment 7 Corey Welton 2011-05-24 01:16:39 UTC
Bookkeeping - closing bug - fixed in recent release.

Comment 8 Corey Welton 2011-05-24 01:16:39 UTC
Bookkeeping - closing bug - fixed in recent release.

Comment 9 Corey Welton 2011-05-24 01:16:44 UTC
Bookkeeping - closing bug - fixed in recent release.


Note You need to log in before you can comment on or make changes to this bug.