Skip to content

Docker network host name resolution seems brittle #594

@robot-ranger

Description

@robot-ranger

Hi Guys,

Im not sure if this is a bug in cppagent per-se and I could use some help narrowing it down.

We run our adapters and agent each in their own docker containers. In our dev contexts we often run all containers in host networking mode for simplicity. However for production and deployment we would like to run all containers in a docker network (ie - agent and all adapters all on the same docker network)

When we do that - we use the container name as host in agent.cfg. This leverages Dockers internal name resolution. It works the first time all containers are brought up.

...however... with the agent container still "up", after restarting adapter container, the agent appears to connect the wrong adapters to the wrong hostname.

For example:

  • mxi_r001 was NOT running; both mxi_m001 and mxi_m002 WERE running and connected fine.
  • I stopped mxi_m001; stopped as expected and the agent shows LISTENING
  • I start mxi_m001; but as you can see below, mxi_m001 is still LISTENING while mxi_r001 is now ESTABLISHED
Image

However, i can clearly see that mxi_r001 container is not even running while mxi_m001 is running!:

Image

... I just cant figure out how/why the agent connected to hostname mxi_r001 when that container is not even running?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions