[ 
https://issues.apache.org/jira/browse/BROOKLYN-546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16216504#comment-16216504
 ] 

ASF GitHub Bot commented on BROOKLYN-546:
-----------------------------------------

Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/867#discussion_r146482165
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/core/mgmt/ha/OsgiArchiveInstaller.java 
---
    @@ -379,8 +379,15 @@ private synchronized void close() {
                     if (canUpdate()) { 
                         result.bundle = 
osgiManager.framework.getBundleContext().getBundle(result.getMetadata().getOsgiUniqueUrl());
                         if (result.getBundle()==null) {
    -                        log.warn("Brooklyn thought is was already managing 
bundle "+result.getMetadata().getVersionedName()+" but it's not installed to 
framework; reinstalling it");
    -                        updating = false;
    +                        if (hasBundleOnInstall(osgiManager, 
inferredMetadata, zipFile)) {
    +                            // e.g. happens if system-bundle is brought 
under management, and then try to add it again:
    +                            // if added from "initial catalog" has it, and 
then added from persisted state as well.
    +                            result.setIgnoringAlreadyInstalled();
    +                            return 
ReferenceWithError.newInstanceWithoutError(result);
    --- End diff --
    
    This return path only takes effect if passing the `canUpdate()` check on 
line 379 but presumably behaviour should be the same as for a non-snapshot 
version?
    
    Is the checksum check we do in the other block (line 397 in new money) is 
equivalent or if we need a super-set check combining that line with 
`hasBundleOnInstall()`.
    
    Probably those checks and the two `ignoringAlreadyInstalled` returns should 
be moved to before line 379.
    
    I'd also rename the new `hasBundleOnInstall` method to 
`isEquivalentBundleAlreadyOsgiInstalled` or something else a little more 
descriptive.


> On restart fails to install catalog bundles due to existing bundles installed 
> with different location
> -----------------------------------------------------------------------------------------------------
>
>                 Key: BROOKLYN-546
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-546
>             Project: Brooklyn
>          Issue Type: Bug
>            Reporter: Duncan Grant
>            Priority: Blocker
>
> Rebind will always fail on restart due to errors like the following:
> java.lang.IllegalStateException: Bundle 
> BasicManagedBundle{symbolicName=org.apache.brooklyn.software-cm-ansible, 
> version=1.0.0.SNAPSHOT, 
> url=mvn:org.apache.brooklyn/brooklyn-software-cm-ansible/1.0.0-SNAPSHOT} 
> failed installation: BundleException: Bundle symbolic name and version are 
> not unique: org.apache.brooklyn.software-cm-ansible:1.0.0.SNAPSHOT
> This seems to have been "caused" by the change: 
> https://github.com/apache/brooklyn-server/pull/862/commits/c4f9d95aa2113a1a5022da17768675599e528dd4
> This can be easily tested by starting brooklyn.  Stopping brooklyn.  And then 
> starting brooklyn.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to