修复关于初始化时间的bug

sledge_graph
hwwang 2 months ago
parent ed80c30ccf
commit 7da0f72179

@ -179,6 +179,10 @@ pre_functions_output_request_add(struct sandbox_request *request, char *output,
**/
static inline void
concatenate_outputs(struct sandbox_request *request) {
if(request->pre_functions_output == NULL) {
return;
}
size_t total_length = 0; // Calculate total length without extra for null character
struct sandbox_pre_functions_output *current = request->pre_functions_output;
@ -229,5 +233,19 @@ concatenate_outputs(struct sandbox_request *request) {
request->previous_function_output = NULL;
}
request->output_length = total_length;
request->previous_function_output = concatenated_output;
request->previous_function_output = concatenated_output;
/**/
if (request->pre_functions_output != NULL)
{
struct sandbox_pre_functions_output *current = request->pre_functions_output;
struct sandbox_pre_functions_output *next = NULL;
while (current) {
next = current->next;
free(current->previous_function_output);
free(current);
current = next; }
request->pre_functions_output = NULL;
}
pthread_spin_destroy(&request->lock);
}

@ -375,7 +375,7 @@ current_sandbox_start(void)
goto err;
};
http_total_increment_2xx();
//http_total_increment_2xx();
sandbox->response_timestamp = __getcycles();

@ -151,18 +151,6 @@ sandbox_allocate(struct sandbox_request *sandbox_request)
/* Set state to initializing */
sandbox_set_as_initialized(sandbox, sandbox_request, now);
if (sandbox_request->pre_functions_output != NULL)
{
struct sandbox_pre_functions_output *current = sandbox_request->pre_functions_output;
struct sandbox_pre_functions_output *next = NULL;
while (current) {
next = current->next;
free(current->previous_function_output);
free(current);
current = next; }
sandbox_request->pre_functions_output = NULL;
}
pthread_spin_destroy(&sandbox_request->lock);
free(sandbox_request);
done:
return sandbox;

@ -266,10 +266,9 @@ software_interrupt_arm_timer(void)
/* if preemption disabled, broadcast sig alarm to all other threads to record the queuelength info */
if (!runtime_preemption_enabled) {
runtime_sigalrm_handler = RUNTIME_SIGALRM_HANDLER_BROADCAST;
return;
}
if (!runtime_preemption_enabled) return;
struct itimerval interval_timer;
memset(&interval_timer, 0, sizeof(struct itimerval));

Loading…
Cancel
Save