docs(executor/sandbox): note on 1 cmd each time
This commit is contained in:
		
							parent
							
								
									b8f782c17d
								
							
						
					
					
						commit
						4f916c79d4
					
				|  | @ -32,10 +32,10 @@ func (e *Sandbox) Run(cmds []stage.Cmd) ([]stage.ExecutorResult, error) { | ||||||
| 				cmd.CopyIn[k] = stage.CmdFile{FileID: &fileID} | 				cmd.CopyIn[k] = stage.CmdFile{FileID: &fileID} | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|  | 		// NOTE: send all cmds at once may cause oom, no idea on why
 | ||||||
| 		pbCmd := convertPBCmd([]stage.Cmd{*cmd}) | 		pbCmd := convertPBCmd([]stage.Cmd{*cmd}) | ||||||
| 		slog.Debug("sandbox execute", "i", i, "pbCmd size", proto.Size(pbCmd[0])) |  | ||||||
| 		pbReq := &pb.Request{Cmd: pbCmd} | 		pbReq := &pb.Request{Cmd: pbCmd} | ||||||
| 		slog.Debug("sandbox execute", "pbReq size", proto.Size(pbReq)) | 		slog.Debug("sandbox execute", "i", i, "pbReq size", proto.Size(pbReq)) | ||||||
| 		pbRet, err := e.execClient.Exec(context.TODO(), pbReq) | 		pbRet, err := e.execClient.Exec(context.TODO(), pbReq) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			return nil, err | 			return nil, err | ||||||
|  | @ -43,6 +43,9 @@ func (e *Sandbox) Run(cmds []stage.Cmd) ([]stage.ExecutorResult, error) { | ||||||
| 		if pbRet.Error != "" { | 		if pbRet.Error != "" { | ||||||
| 			return nil, fmt.Errorf("sandbox execute error: %s", pbRet.Error) | 			return nil, fmt.Errorf("sandbox execute error: %s", pbRet.Error) | ||||||
| 		} | 		} | ||||||
|  | 		if len(pbRet.Results) == 0 { | ||||||
|  | 			return nil, fmt.Errorf("sandbox execute error: no result") | ||||||
|  | 		} | ||||||
| 		result := convertPBResult(pbRet.Results)[0] | 		result := convertPBResult(pbRet.Results)[0] | ||||||
| 		maps.Copy(e.cachedMap, result.FileIDs) | 		maps.Copy(e.cachedMap, result.FileIDs) | ||||||
| 		results[i] = result | 		results[i] = result | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user