mozilla / mig

Distributed & real time digital forensics at the speed of the cloud

Home Page:http://mig.mozilla.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

possible race condition on environment collection and relay connect

ameihm0912 opened this issue · comments

in the case of a newly started system, it appears possible in some cases the agent could do environment collection before an ipv4 address has been assigned to the interface, but is still able to connect to the relay if the address is assigned before this phase. this causes problems as the hostname or addresses associated with the agent are invalid (e.g., it could have a hostname of localhost and nothing in the addresses list). following this, for the lifetime of the current agent process its environment is only partially valid.

@jvehent this needs more research, but what do you think about just exiting after environment collection if the environment does not contain a valid inet4 address, or only contains inet6 link local addresses? and allowing the service manager to attempt restarts later when we have a valid address.

im not sure of a great solution other than maybe periodically doing environment collection, and exiting if we notice the agents environment has changed, so we restart a new agent with the right environment.