diff --git a/go.mod b/go.mod index 891237c..acc1771 100644 --- a/go.mod +++ b/go.mod @@ -11,6 +11,7 @@ require ( github.com/mcuadros/go-defaults v1.2.0 github.com/mitchellh/mapstructure v1.5.0 google.golang.org/grpc v1.67.1 + google.golang.org/protobuf v1.35.1 ) require ( @@ -41,7 +42,6 @@ require ( golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.19.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241021214115-324edc3d5d38 // indirect - google.golang.org/protobuf v1.35.1 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/internal/executor/sandbox/executor.go b/internal/executor/sandbox/executor.go index 40afa00..01311ee 100644 --- a/internal/executor/sandbox/executor.go +++ b/internal/executor/sandbox/executor.go @@ -7,6 +7,7 @@ import ( "github.com/criyle/go-judge/pb" "github.com/joint-online-judge/JOJ3/internal/stage" + "google.golang.org/protobuf/proto" ) type Sandbox struct { @@ -37,7 +38,24 @@ func (e *Sandbox) Run(cmds []stage.Cmd) ([]stage.ExecutorResult, error) { } } pbCmds := convertPBCmd(cmds) - slog.Debug("sandbox execute", "protobuf cmds", pbCmds) + for i, pbCmd := range pbCmds { + slog.Debug( + "sandbox execute", + "index", i, + "protobuf cmd size", proto.Size(pbCmd), + "protobuf cmd stdin size", proto.Size(pbCmd.Files[0]), + "protobuf cmd stdout size", proto.Size(pbCmd.Files[1]), + "protobuf cmd stderr size", proto.Size(pbCmd.Files[2]), + ) + for k, v := range pbCmd.CopyIn { + slog.Debug( + "sandbox execute", + "index", i, + "CopyIn filename", k, + "protobuf file size", proto.Size(v), + ) + } + } pbReq := &pb.Request{Cmd: pbCmds} pbRet, err := e.execClient.Exec(context.TODO(), pbReq) if err != nil {