sonatype/nexus — pull request #554 by cstamas (2012-10-01 11:48:39+00:00)
Title: NEXUS-5280: ContextMemberProvider should always return same list of members

But, we forgot to handle a special case: there is one case, when instead
of the group member change, a member configuration change might cause that
group context list MUST change, the groups
ContextMemberProvider pre-built list must change: that when
Repository#setIndexable() is changed (if change from true to false, context
is removed from NexusIndexer, if changed from false to true, context is being
created). This case was not handled, and groups (who's member was made
non-indexable) was still containing and handing over a "stale", already
shut down context to indexer components.

In other words, with original change, the list remain unchanged, even if the context was
shut down and removed from NexusIndexer, but group continued to use it, that
caused NPE (IndexSearcher is closed and nullified on shut down contexts),
but also some cleanup problem exists in MI and NPE caused IllegalMonitorState
(NPE happened during locking, so not all context were actually locked,
but against all were unlock tried).

Now, repository updates are propagated to groups where it is contained.

Added UT that tests exactly this case: making a repo from indexable
to non-indexable and back to indexable, while verifying that it's group
is not running into those sort of problems.

CI:
https://builds.sonatype.org/view/nexus-features/job/nexus-oss-its-feature/426/