Merge pull request #338 from fnproject/fix-nilly

not ready for spans yet in hot land
This commit is contained in:
Reed Allman
2017-09-18 15:29:46 -07:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

@@ -596,6 +596,7 @@ func (a *agent) runHot(slots chan<- slot, call *call, tok Token) error {
} }
logger := logrus.WithFields(logrus.Fields{"id": container.id, "app": call.AppName, "route": call.Path, "image": call.Image, "memory": call.Memory, "format": call.Format, "idle_timeout": call.IdleTimeout}) logger := logrus.WithFields(logrus.Fields{"id": container.id, "app": call.AppName, "route": call.Path, "image": call.Image, "memory": call.Memory, "format": call.Format, "idle_timeout": call.IdleTimeout})
ctx = common.WithLogger(ctx, logger)
cookie, err := a.driver.Prepare(ctx, container) cookie, err := a.driver.Prepare(ctx, container)
if err != nil { if err != nil {

View File

@@ -16,7 +16,6 @@ import (
"github.com/fnproject/fn/api/models" "github.com/fnproject/fn/api/models"
"github.com/fsouza/go-dockerclient" "github.com/fsouza/go-dockerclient"
"github.com/opentracing/opentracing-go" "github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/log"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
@@ -459,7 +458,8 @@ func (drv *DockerDriver) wait(ctx context.Context, container string) (status str
case 0: case 0:
return drivers.StatusSuccess, nil return drivers.StatusSuccess, nil
case 137: // OOM case 137: // OOM
opentracing.SpanFromContext(ctx).LogFields(log.String("docker", "oom")) // TODO put in stats opentracing.SpanFromContext(ctx).LogFields(log.String("docker", "oom"))
common.Logger(ctx).Error("docker oom")
return drivers.StatusKilled, models.NewAPIError(http.StatusBadGateway, errors.New("container out of memory")) return drivers.StatusKilled, models.NewAPIError(http.StatusBadGateway, errors.New("container out of memory"))
} }
} }