Uploaded image for project: 'Marathon'
  1. Marathon
  2. MARATHON-8452

Only log zero-value offers if they have a scalar value set

    Details

      Description

      (reported via slack by Ivan Chernetsky)

      It seems that

       private def warnOnZeroResource(offer: Offer): Unit = {
          val resourcesWithZeroValues = offer
            .getResourcesList.asScala
            .collect {
              case resource if resource.getScalar.getValue.ceil.toLong == 0 =>
                resource.getName
            }
          if (resourcesWithZeroValues.nonEmpty) {
            logger.warn(s"Offer ${offer.getId.getValue} has zero-valued resources: ${resourcesWithZeroValues.mkString(", ")}")
          }
        }
      

      always logs ports here, because it is not a scalar.

      --- a/src/main/scala/mesosphere/marathon/core/launcher/impl/OfferProcessorImpl.scala
      +++ b/src/main/scala/mesosphere/marathon/core/launcher/impl/OfferProcessorImpl.scala
      @@ -81,7 +81,9 @@ private[launcher] class OfferProcessorImpl(
           val resourcesWithZeroValues = offer
             .getResourcesList.asScala
             .collect {
      -        case resource if resource.getScalar.getValue.ceil.toLong == 0 =>
      +        case resource if resource.hasScalar && resource.getScalar.getValue.ceil.toLong == 0 =>
      +          resource.getName
      +        case resource if resource.hasRanges && resource.getRanges.getRangeCount == 0 =>
                 resource.getName
             }
           if (resourcesWithZeroValues.nonEmpty) {
      

      I guess it should work like this.

        Attachments

          Activity

            People

            • Assignee:
              matthias.eichstedt Matthias Eichstedt
              Reporter:
              matthias.eichstedt Matthias Eichstedt
              Team:
              Orchestration Team
              Watchers:
              Matthias Eichstedt, Mergebot
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: