When matching offers for resident tasks, Marathon would not consider instances in state Reserved when validating constraints. This potentially resulted in multiple reservations on the same agent, even if a hostname: unique constraint was applied to the run spec. The problem boils down to the fact that the ResourceMatcher filtered for instance.isLaunched and only considered those instances. This was accidentally introduced via the fact that previously, instances which weren't launched had no runSpecVersion and therefore could not be compared to the last config change.
Compare 3bf03f86, which needed to access _.launched to compare the version. Deriving the need to check for isLaunched later was a wrong assumption.
While at it, StrictLogging has been introduced and unnecessary if(xyzEnabled) statements have been removed.
Added two unit tests for offer matching with unique constraints
wondering why did we have the .isLaunched filter here before?