Skip to content

Commit

Permalink
Do not set wfid/wftype to MDC in parent process on async execution
Browse files Browse the repository at this point in the history
  • Loading branch information
oliwel committed Jan 18, 2021
1 parent 57279cd commit fff84e0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/server/OpenXPKI/Server/API2/Plugin/Workflow/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ sub execute_activity {
my ($self, $wf, $activity, $async, $wait) = @_;
##! 2: 'execute activity ' . $activity

Log::Log4perl::MDC->put('wfid', $wf->id());
Log::Log4perl::MDC->put('wftype', $wf->type());

# ASYNCHRONOUS - fork
if ($async) {
$self->_execute_activity_async($wf, $activity); # returns the background process PID
Expand All @@ -120,6 +117,10 @@ sub execute_activity {
}
# SYNCHRONOUS
else {

Log::Log4perl::MDC->put('wfid', $wf->id());
Log::Log4perl::MDC->put('wftype', $wf->type());

$self->_execute_activity_sync($wf, $activity); # modifies the $workflow object (and so $updated_workflow)
return $wf;
}
Expand Down Expand Up @@ -244,6 +245,9 @@ sub _execute_activity_async {
return $pid;
}

Log::Log4perl::MDC->put('wfid', $workflow->id());
Log::Log4perl::MDC->put('wftype', $workflow->type());

# child process
try {
##! 16: ' Workflow instance succesfully forked - I am the workflow'
Expand Down

0 comments on commit fff84e0

Please sign in to comment.