@@ -138,7 +138,6 @@ pub trait NodeExecutor: Sync + Send {
138
138
139
139
pub struct InvokeResponse {
140
140
pub response : JsonValue ,
141
- pub memory_used_in_mb : u64 ,
142
141
pub aws_request_id : Option < String > ,
143
142
}
144
143
@@ -237,7 +236,6 @@ impl<RT: Runtime> Actions<RT> {
237
236
} ;
238
237
let InvokeResponse {
239
238
response,
240
- memory_used_in_mb,
241
239
aws_request_id,
242
240
} = self . executor . invoke ( request, log_line_sender) . await ?;
243
241
let execute_result = ExecuteResponse :: try_from ( response. clone ( ) ) . map_err ( |e| {
@@ -301,7 +299,8 @@ impl<RT: Runtime> Actions<RT> {
301
299
Ok ( NodeActionOutcome {
302
300
result,
303
301
syscall_trace,
304
- memory_used_in_mb,
302
+ // This shouldn't ever be None, but we'll use the default 512MB as a fallback.
303
+ memory_used_in_mb : execute_result. memory_allocated_mb . unwrap_or ( 512 ) ,
305
304
} )
306
305
}
307
306
@@ -315,7 +314,6 @@ impl<RT: Runtime> Actions<RT> {
315
314
let request = ExecutorRequest :: BuildDeps ( request) ;
316
315
let InvokeResponse {
317
316
response,
318
- memory_used_in_mb : _,
319
317
aws_request_id,
320
318
} = self . executor . invoke ( request, log_line_sender) . await ?;
321
319
let response: BuildDepsResponse =
@@ -394,7 +392,6 @@ impl<RT: Runtime> Actions<RT> {
394
392
395
393
let InvokeResponse {
396
394
response,
397
- memory_used_in_mb : _,
398
395
aws_request_id,
399
396
} = self . invoke_analyze ( request) . await ?;
400
397
let response: AnalyzeResponse = serde_json:: from_value ( response. clone ( ) ) . map_err ( |e| {
@@ -687,6 +684,7 @@ struct ExecuteResponse {
687
684
udf_time : Option < Duration > ,
688
685
total_executor_time : Option < Duration > ,
689
686
syscall_trace : SyscallTrace ,
687
+ memory_allocated_mb : Option < u64 > ,
690
688
}
691
689
692
690
#[ derive( Debug , PartialEq ) ]
@@ -747,6 +745,7 @@ impl TryFrom<JsonValue> for ExecuteResponse {
747
745
udf_time_ms : Option < f64 > ,
748
746
total_executor_time_ms : Option < f64 > ,
749
747
syscall_trace : Option < BTreeMap < String , SyscallStatsJson > > ,
748
+ memory_allocated_mb : Option < u64 > ,
750
749
} ,
751
750
#[ serde( rename_all = "camelCase" ) ]
752
751
Error {
@@ -760,6 +759,7 @@ impl TryFrom<JsonValue> for ExecuteResponse {
760
759
udf_time_ms : Option < f64 > ,
761
760
total_executor_time_ms : Option < f64 > ,
762
761
syscall_trace : Option < BTreeMap < String , SyscallStatsJson > > ,
762
+ memory_allocated_mb : Option < u64 > ,
763
763
} ,
764
764
}
765
765
let resp_json: ExecuteResponseJson = serde_json:: from_value ( v) ?;
@@ -772,6 +772,7 @@ impl TryFrom<JsonValue> for ExecuteResponse {
772
772
udf_time_ms,
773
773
total_executor_time_ms,
774
774
syscall_trace,
775
+ memory_allocated_mb,
775
776
} => ExecuteResponse {
776
777
result : ExecuteResponseResult :: Success { udf_return } ,
777
778
num_invocations : Some ( num_invocations) ,
@@ -785,6 +786,7 @@ impl TryFrom<JsonValue> for ExecuteResponse {
785
786
. map ( |( k, v) | ( k, v. into ( ) ) )
786
787
. collect :: < BTreeMap < _ , SyscallStats > > ( )
787
788
. into ( ) ,
789
+ memory_allocated_mb,
788
790
} ,
789
791
ExecuteResponseJson :: Error {
790
792
message,
@@ -797,6 +799,7 @@ impl TryFrom<JsonValue> for ExecuteResponse {
797
799
udf_time_ms,
798
800
total_executor_time_ms,
799
801
syscall_trace,
802
+ memory_allocated_mb,
800
803
} => ExecuteResponse {
801
804
result : ExecuteResponseResult :: Error {
802
805
message,
@@ -815,6 +818,7 @@ impl TryFrom<JsonValue> for ExecuteResponse {
815
818
. map ( |( k, v) | ( k, v. into ( ) ) )
816
819
. collect :: < BTreeMap < _ , SyscallStats > > ( )
817
820
. into ( ) ,
821
+ memory_allocated_mb,
818
822
} ,
819
823
} ;
820
824
Ok ( result)
0 commit comments