REVIEW: NEXUS-5602: Using the periodic update thread for initial updates too #792

Merged
merged 1 commit into from Mar 29, 2013

Conversation

Projects
None yet
4 participants
Contributor

cstamas commented Mar 27, 2013

On 1st boot of updated instances, a lot of MavenRepository
instances (hosted and proxy) will be piled up in the array
needUpdateRepositories in WLManagerImpl#startup().

Currently, as the thread pool with fixed size of 5 and
blocking queue was deferring update.

With this change, the for-loop doing initial WL build
(walk of the content for hosted and discovery for proxies)
is deferred, and periodic updater thread is used.

This also means, that upon boot, the initial delay of
first run will be applied, and on that moment on, hosted
reposes will have WL, not before that.

- // these will maintaing groups too as needed
- for ( MavenRepository mavenRepository : needUpdateRepositories )
+ // add the periodic thread only when feature is active
+ if ( config.isFeatureActive() )
@ifedorenko

ifedorenko Mar 28, 2013

Contributor

Why do anything during startup() if autorouting is disabled?

}
@Override
public void shutdown()
{
- eventBus.unregister( eventDispatcher );
+ if ( config.isFeatureActive() )
@ifedorenko

ifedorenko Mar 28, 2013

Contributor

Why does it matter if the feature is enabled or not? Shutdown should unregister eventDispatcher regardless.

@@ -170,7 +161,7 @@ protected boolean isRepositoryHandled( final Repository repository )
{
// we handle repository events after this isActive, is not out of service, and only for non-shadow repository
// that are Maven2 reposes
- return isActive() && repository != null
@nabcos

nabcos Mar 28, 2013

Contributor

comment does not seem to match the code anymore

Contributor

jdillon commented Mar 28, 2013

sure

NEXUS-5602: Using the periodic update thread for initial updates too
On 1st boot of updated instances, a lot of MavenRepository
instances (hosted and proxy) will be piled up in the array
needUpdateRepositories in WLManagerImpl#startup().

Currently, as the thread pool with fixed size of 5 and
blocking queue was deferring update.

With this change, the for-loop doing initial WL build
(walk of the content for hosted and discovery for proxies)
is deferred, and periodic updater thread is used.

This also means, that upon boot, the initial delay of
first run will be applied, and on that moment on, hosted
reposes will have WL, not before that.

Initial change breaks all the UTs and ITs that uses
exposed-for-tests-only method to reach a state when
the test should start.

isUpdateWhitelistJobRunning() method used for this
is now updated, and will flag (and make tests wait)
as long as boot sequence is done (newly added) AND
there are no bg updates running (as before).

Also, EventDispatcher simplified, the feature active
flag is not passed anymore, instead, it is not
registered to event bus when feature is not
active, resulting in same behavior (before, when
feature was inactive EventDispatcher got events
but simply did not invoke WL Manager).
Contributor

cstamas commented Mar 28, 2013

CI Started after rebase against master with renames:
https://bamboo.zion.sonatype.com/browse/NXO-OSSF42-5

Contributor

cstamas commented Mar 29, 2013

Previous CI "succeeded" with one unrelated IT failure.

Next CI +1'd
https://bamboo.zion.sonatype.com/browse/NXO-OSSF42-6

cstamas added a commit that referenced this pull request Mar 29, 2013

Merge pull request #792 from sonatype/nexus-5602-using-updater-for-in…
…itial-update

REVIEW: NEXUS-5602: Using the periodic update thread for initial updates too

@cstamas cstamas merged commit 581eff5 into master Mar 29, 2013

@cstamas cstamas deleted the nexus-5602-using-updater-for-initial-update branch Mar 29, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment