Skip to content

Commit

Permalink
fix(agent.host): Missing spans when handling forked processes.
Browse files Browse the repository at this point in the history
In multithreaded applications (services), only the first or master
process is announced to the Agent when the service starts, but if a
not announced forked process handles the (HTTP) ENTRY requests and it
contains one or more EXIT spans created during the first request,
those EXIT spans are missed and not reported.

This fix returns True when agent.host.can_send() method is called and
detected that the current process is a forked (and not yet announced).
All EXIT spans will not be discarded before announcing the forked
process to the Agent.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
  • Loading branch information
pvital committed Oct 17, 2023
1 parent 55e826e commit ec04f7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion instana/agent/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def can_send(self):
self._boot_pid = current_pid
logger.debug("Fork detected; Handling like a pro...")
self.handle_fork()
return False
return True

if self.machine.fsm.current in ["wait4init", "good2go"]:
return True
Expand Down

0 comments on commit ec04f7b

Please sign in to comment.