From f4ea6a15c82e24ab50e47212e8c74de1334f5ce2 Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Fri, 5 Feb 2016 10:55:03 -0800 Subject: [PATCH] Making the java driver apply resource constraints and limits --- client/driver/java.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/client/driver/java.go b/client/driver/java.go index 1fdac01db..6ad6baabc 100644 --- a/client/driver/java.go +++ b/client/driver/java.go @@ -158,10 +158,13 @@ func (d *JavaDriver) Start(ctx *ExecContext, task *structs.Task) (DriverHandle, return nil, err } executorCtx := &executor.ExecutorContext{ - TaskEnv: d.taskEnv, - AllocDir: ctx.AllocDir, - TaskName: task.Name, - TaskResources: task.Resources, + TaskEnv: d.taskEnv, + AllocDir: ctx.AllocDir, + TaskName: task.Name, + TaskResources: task.Resources, + FSIsolation: true, + ResourceLimits: true, + UnprivilegedUser: true, } ps, err := exec.LaunchCmd(&executor.ExecCommand{Cmd: "java", Args: args}, executorCtx) if err != nil {