Skip to content

Commit

Permalink
Fix log presentation
Browse files Browse the repository at this point in the history
Putting back-off delay at the end makes it unlikely to see it because
when there are too many scheduledInstances, log get truncated by
rsyslog. Delay is more important and having an extract of few
scheduledInstances is enough.
  • Loading branch information
Lqp1 committed Feb 3, 2021
1 parent 833036c commit 9eb4713
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ private[launcher] class OfferProcessorImpl(
private def logOffer(offer: Offer): Unit = {
val offerId = offer.getId.getValue
val agentId = offer.getSlaveId.getValue
logger.debug(s"Processing offer: offerId $offerId, agentId $agentId")
logger.info(s"Processing offer: offerId $offerId, agentId $agentId (${offer.getHostname})")
logger.debug(offer.toString)
}

// This is likely beginning of offer matching
override def processOffer(offer: Offer): Future[Done] = {
incomingOffersMetric.increment()
logOffer(offer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ private class TaskLauncherActor(
private[this] def launchAllowed(now: Timestamp, configRef: RunSpecConfigRef): Boolean = launchAllowedAt.get(configRef).exists(_ <= now)
private[this] def shouldLaunchInstances(now: Timestamp): Boolean = {
if (scheduledInstances.nonEmpty || launchAllowedAt.nonEmpty)
logger.info(s"Found scheduled instances: ${scheduledInstances.map(_.instanceId).mkString(",")} and current back-off map: $launchAllowedAt")
logger.info(s"Found scheduled instances (current back-off map $launchAllowedAt): ${scheduledInstances.map(_.instanceId).mkString(",")}")
scheduledInstances.nonEmpty && scheduledVersions.exists { configRef => launchAllowed(now, configRef) }
}

Expand Down

0 comments on commit 9eb4713

Please sign in to comment.