From 47132af474d6bf863463146694fb862da4808728 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Tue, 23 Jan 2018 15:54:10 -0800 Subject: [PATCH] Add maxmemory protection to FSET --- controller/crud.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/controller/crud.go b/controller/crud.go index 1467ed1a..9eb4c144 100644 --- a/controller/crud.go +++ b/controller/crud.go @@ -824,6 +824,10 @@ func (c *Controller) parseFSetArgs(vs []resp.Value) ( } func (c *Controller) cmdFset(msg *server.Message) (res resp.Value, d commandDetailsT, err error) { + if c.config.maxMemory() > 0 && c.outOfMemory.on() { + err = errOOM + return + } start := time.Now() vs := msg.Values[1:] var fields []string