I did a bit more playing around with this and I think I figured out what's going on.
I'm guessing most people just use the packaged Felix launcher that comes with ACE, so they don't run into this, but I'm using the latest Felix framework distribution and having the ACE agent bundle loaded from the auto-deploy directory. In my Felix configuration, I had the following line: felix.auto.deploy.action=install,start,update,uninstall Any time I restarted the framework, the bundles in the cache would get flushed back down to just the framework and the ACE agent, and ACE would keep syncing on the configured interval and log this: INFO|15160/0||15-06-20 22:09:10|DEBUG: WIRE: [org.apache.ace.agent [1](R 1.1)] osgi.wiring.package; (osgi.wiring.package=javax.net.ssl) -> [org.apache.felix.framework [0](R 0)] INFO|15160/0||15-06-20 22:09:10|DEBUG: WIRE: [org.apache.ace.agent [1](R 1.1)] osgi.wiring.package; (osgi.wiring.package=javax.xml.bind) -> [org.apache.felix.framework [0](R 0)] INFO|15160/0||15-06-20 22:09:10|DEBUG: WIRE: [org.apache.ace.agent [1](R 1.1)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.5.0)(!(version>=2.0.0))) -> [org.apache.felix.framework [0](R 0)] INFO|15160/0||15-06-20 22:09:10|DEBUG: WIRE: [org.apache.ace.agent [1](R 1.1)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.service.packageadmin)(version>=1.2.0)(!(version>=2.0.0))) -> [org.apache.felix.framework [0](R 0)] INFO|15160/0||15-06-20 22:09:10|[DEBUG] 22:09:10 (discovery) Discovery configuration changed: urls: [<removed>], checking: true INFO|15160/0||15-06-20 22:09:10|[DEBUG] 22:09:10 (controller) Config initialized: update: true, fixPkg: true, syncDelay: 5, syncInterval: 14, maxRetries: 1 INFO|15160/0||15-06-20 22:09:10|[DEBUG] 22:09:10 (controller) Scheduling controller to run in 5 seconds... INFO|15160/0||15-06-20 22:09:15|[DEBUG] 22:09:15 (controller) Controller syncing... INFO|15160/0||15-06-20 22:09:15|[DEBUG] 22:09:15 (controller) Synchronizing feedback channels: [auditlog] INFO|15160/0||15-06-20 22:09:15|[DEBUG] 22:09:15 (discovery) Succesfully connected to serverURL: <removed> INFO|15160/0||15-06-20 22:09:16|[DEBUG] 22:09:16 (controller) Feedback send succesfully for channel: auditlog INFO|15160/0||15-06-20 22:09:16|[DEBUG] 22:09:16 (controller) Checking for agent updates... INFO|15160/0||15-06-20 22:09:16|[DEBUG] 22:09:16 (discovery) Returning cached serverURL: <removed> INFO|15160/0||15-06-20 22:09:16|[DEBUG] 22:09:16 (controller) No need to install update: no newer agent version available! INFO|15160/0||15-06-20 22:09:16|[DEBUG] 22:09:16 (controller) Checking for deployment updates... INFO|15160/0||15-06-20 22:09:16|[DEBUG] 22:09:16 (discovery) Returning cached serverURL: <removed> INFO|15160/0||15-06-20 22:09:16|[DEBUG] 22:09:16 (controller) No need to install update: no newer deployment version available! INFO|15160/0||15-06-20 22:09:16|[DEBUG] 22:09:16 (controller) Sync completed... INFO|15160/0||15-06-20 22:09:16|[DEBUG] 22:09:16 (controller) Scheduling controller to run in 14 seconds... INFO|15160/0||15-06-20 22:09:30|[DEBUG] 22:09:30 (controller) Controller syncing... INFO|15160/0||15-06-20 22:09:30|[DEBUG] 22:09:30 (controller) Synchronizing feedback channels: [auditlog] INFO|15160/0||15-06-20 22:09:30|[DEBUG] 22:09:30 (discovery) Returning cached serverURL: <removed> INFO|15160/0||15-06-20 22:09:30|[DEBUG] 22:09:30 (controller) Feedback send succesfully for channel: auditlog INFO|15160/0||15-06-20 22:09:30|[DEBUG] 22:09:30 (controller) Checking for agent updates... INFO|15160/0||15-06-20 22:09:30|[DEBUG] 22:09:30 (discovery) Returning cached serverURL: <removed> INFO|15160/0||15-06-20 22:09:31|[DEBUG] 22:09:30 (controller) No need to install update: no newer agent version available! INFO|15160/0||15-06-20 22:09:31|[DEBUG] 22:09:30 (controller) Checking for deployment updates... INFO|15160/0||15-06-20 22:09:31|[DEBUG] 22:09:30 (discovery) Returning cached serverURL:<removed> INFO|15160/0||15-06-20 22:09:31|[DEBUG] 22:09:31 (controller) No need to install update: no newer deployment version available! INFO|15160/0||15-06-20 22:09:31|[DEBUG] 22:09:31 (controller) Sync completed... INFO|15160/0||15-06-20 22:09:31|[DEBUG] 22:09:31 (controller) Scheduling controller to run in 14 seconds... When I removed the "uninstall" action, everything with the cache started working as expected. It seems to me that what happens is when starting the framework (any time after the first) with the "uninstall" action specified, the Felix auto-deployer removes any bundles from the cache that aren't in the auto-deploy directory. After that point, the ACE agent doesn't sync the latest deployment version, even after framework restarts, until the bundle cache is completely deleted. I'm not sure this is a "bug" in the agent, but it is a somewhat unexpected interaction. How does the agent determine the current deployment version of the client? However it does, it appears it's possible to get irrecoverably out of sync with the actual deployment state of the framework. I'd be happy to file a bug report if anyone is interested in digging further into this. For now, I can get by just removing the "uninstall" action from the felix auto-deploy configuration. Robert On Fri, Jun 12, 2015 at 11:06 AM, Jan Willem Janssen < [email protected]> wrote: > Hi, > > > On 12 Jun 2015, at 19:58, Robert M. Mather <[email protected]> > wrote: > > > > If I restart my client application running the ACE agent without the > Felix > > setting > > "org.osgi.framework.storage.clean=onFirstInit" > > then the agent doesn't download any bundles from the server when starting > > up. I'd prefer to use the default behavior so that if the client restarts > > at a time when the ace server happens to be unavailable, it can still > start > > with the most recent set of bundles from the local cache. > > > > Any theories on why this might be the case? The ace agent jar is located > in > > the felix auto deploy directory. Below is my Felix configuration and the > > system properties affecting ace: > > > > # > > # Felix framework config properties. > > # > > > > felix.cache.rootdir=${user.dir}/cache > > org.osgi.framework.storage=${felix.cache.rootdir}/felix > > > > # Start ACE agent automatically > > felix.auto.deploy.action=install,start,update,uninstall > > > > # The following property controls whether the bundle cache is flushed > > # the first time the framework is initialized. Possible values are > > # "none" and "onFirstInit"; the default is "none". > > # The ACE agent doesn't properly sync bundles unless the cache is flushed > > org.osgi.framework.storage.clean=onFirstInit > > > > # DEBUG level logging > > felix.log.level=4 > > > > # System Properties > > # variable gets interpolated by installer > > agent.discovery.serverurls=${aceUrl} > > agent.controller.syncinterval=420 > > The ACE agent should work correctly without the necessity of cache > flushes. It is > more or less the entire purpose of the agent :) So far, we’ve never heard > or seen > this issue before, but without any details from logging or something it is > kind of > hard to determine the root cause. Can you bump the log level a bit to see > if any- > thing particular is logged? See [1] for details on how to do that. > > HtH, > > 1. http://ace.apache.org/docs/user-guide.html#target-configuration > > -- > Met vriendelijke groeten | Kind regards > > Jan Willem Janssen | Software Architect > +31 631 765 814 > > My world is revolving around INAETICS and Amdatu > > Luminis Technologies B.V. > Churchillplein 1 > 7314 BZ Apeldoorn > +31 88 586 46 00 > > http://www.luminis-technologies.com > http://www.luminis.eu > > KvK (CoC) 09 16 28 93 > BTW (VAT) NL8169.78.566.B.01 > >
