bitsofinfo / hazelcast-docker-swarm-discovery-spi

Docker Swarm based discovery strategy SPI for Hazelcast enabled applications
Apache License 2.0
39 stars 33 forks source link

Stopped tasks are also considered as qualified docker service task #2

Closed gaborho closed 7 years ago

gaborho commented 7 years ago

Hi,

It seems service tasks which are in Exited status are also considered as qualified docker service tasks. Is this by intention or is it a bug? The Hazelcast cluster is however still formulated, but there are some connection errors for IP addressess of the exited containers.

swarm-worker000000:~$ docker ps -a |grep sve_hm e9dd09b9217b 015793701309.dkr.ecr.eu-west-1.amazonaws.com/sve-azure/hm:v1 "bash /opt/hm/bin/..." About an hour ago Up About an hour 8080/tcp, 8443/tcp sve_hm.3.xv1fgx0ct15qbz8e3bkiqpb9b cf4f8d1bdaa4 015793701309.dkr.ecr.eu-west-1.amazonaws.com/sve-azure/hm:v1 "bash /opt/hm/bin/..." 2 hours ago Up 2 hours 8080/tcp, 8443/tcp sve_hm.2.cq6kos5f5keua9evi4t9vryy3 5d80ef6b4d0b 015793701309.dkr.ecr.eu-west-1.amazonaws.com/sve-azure/hm:v1 "bash /opt/hm/bin/..." 2 hours ago Exited (137) 2 hours ago sve_hm.2.pgjd1g7p76avzri9k996qzh3o f89ee68e2f7c 015793701309.dkr.ecr.eu-west-1.amazonaws.com/sve-azure/hm:v1 "bash /opt/hm/bin/..." 3 hours ago Exited (137) 2 hours ago sve_hm.2.kekxffist9vuozdah4o81bszg 7237b5bd0bbb 015793701309.dkr.ecr.eu-west-1.amazonaws.com/sve-azure/hm:v1 "bash /opt/hm/bin/..." 22 hours ago Exited (137) 3 hours ago sve_hm.2.5d2gdmklm13fnjlcusasjonja

swarm-worker000001:~$ docker ps |grep hm d05193b48f8f 015793701309.dkr.ecr.eu-west-1.amazonaws.com/sve-azure/hm:v1 "bash /opt/hm/bin/..." 47 seconds ago Up 33 seconds 8080/tcp, 8443/swarm-worker000001:~$ docker ps -a |grep sve_hm d05193b48f8f 015793701309.dkr.ecr.eu-west-1.amazonaws.com/sve-azure/hm:v1 "bash /opt/hm/bin/..." 2 hours ago Up 2 hours 8080/tcp, 8443/tcp sve_hm.1.uqf59dvy22w7wkvnwi5n8iwv0 e47539962650 015793701309.dkr.ecr.eu-west-1.amazonaws.com/sve-azure/hm:v1 "bash /opt/hm/bin/..." 2 hours ago Exited (137) 2 hours ago sve_hm.1.lst4hynwtpfvfoyz9sx1llvdz fcd0dd9c234b 015793701309.dkr.ecr.eu-west-1.amazonaws.com/sve-azure/hm:v1 "bash /opt/hm/bin/..." 3 hours ago Exited (137) 2 hours ago sve_hm.1.s8izchdx7ocapevwhv21tv3u2 524e3574dc28 015793701309.dkr.ecr.eu-west-1.amazonaws.com/sve-azure/hm:v1 "bash /opt/hm/bin/..." 22 hours ago Exited (137) 3 hours ago sve_hm.1.vl28xo6wealy4dd8aqyfoefvv

In log following services are considered:

INFO Found relevant docker network: sve_svenetwork[o3p63mi0yc2n5rclvsahz4jou] INFO Found qualifying docker service[sve_hm] on network: sve_svenetwork[o3p63mi0yc2n5rclvsahz4jou:10.0.0.32/24] INFO Found qualifying docker service task[taskId: 5d2gdmklm13fnjlcusasjonja, container:7237b5bd0bbb16738bd815ae9a2e71254f7f96756b7bb216c5826155248f2853] on network: sve_svenetwork[o3p63mi0yc2n5rclvsahz4jou:10.0.0.5/24] INFO Found qualifying docker service task[taskId: 761iwko93k9ni7707ec0rui7v, container:null] on network: sve_svenetwork[o3p63mi0yc2n5rclvsahz4jou:10.0.0.37/24] INFO Found qualifying docker service task[taskId: 8c60hpncgr76thvah50s63pz8, container:null] on network: sve_svenetwork[o3p63mi0yc2n5rclvsahz4jou:10.0.0.27/24] INFO Found qualifying docker service task[taskId: cq6kos5f5keua9evi4t9vryy3, container:cf4f8d1bdaa40b06fe787d96737f30337a3493aa1200c53cf7e475fe98bb3d4f] on network: sve_svenetwork[o3p63mi0yc2n5rclvsahz4jou:10.0.0.3/24] INFO Found qualifying docker service task[taskId: kekxffist9vuozdah4o81bszg, container:f89ee68e2f7c7664f45cb5d6380dc57d1a4f929e5715d4771745e477229f0b65] on network: sve_svenetwork[o3p63mi0yc2n5rclvsahz4jou:10.0.0.3/24] INFO Found qualifying docker service task[taskId: lst4hynwtpfvfoyz9sx1llvdz, container:e47539962650c54d1265fa0e3996f914723d10f45534116d63b1a752517cc90f] on network: sve_svenetwork[o3p63mi0yc2n5rclvsahz4jou:10.0.0.3/24] INFO Found qualifying docker service task[taskId: pgjd1g7p76avzri9k996qzh3o, container:5d80ef6b4d0b355b3adfa2ca0f0feb08e10fd246949d3d3e46c6467a89b0c111] on network: sve_svenetwork[o3p63mi0yc2n5rclvsahz4jou:10.0.0.9/24] INFO Found qualifying docker service task[taskId: s8izchdx7ocapevwhv21tv3u2, container:fcd0dd9c234b1d0cbe13ce1b14ae1716f402eebba419f75828419efb059fcc18] on network: sve_svenetwork[o3p63mi0yc2n5rclvsahz4jou:10.0.0.5/24] INFO Found qualifying docker service task[taskId: uqf59dvy22w7wkvnwi5n8iwv0, container:d05193b48f8f0f0aaa8f4b62453dd23e6f220562a89a364384b086b48f0b6d59] on network: sve_svenetwork[o3p63mi0yc2n5rclvsahz4jou:10.0.0.5/24] INFO Found qualifying docker service task[taskId: vl28xo6wealy4dd8aqyfoefvv, container:524e3574dc28961c6dccb546949d0b69e09ee98d70d64c4bcf77aa05abc2ad2b] on network: sve_svenetwork[o3p63mi0yc2n5rclvsahz4jou:10.0.0.7/24] INFO Found qualifying docker service task[taskId: xv1fgx0ct15qbz8e3bkiqpb9b, container:e9dd09b9217bd328a2ccc2acafceba29d4a8889ed7e5f037ddeeae25f16fd97f] on network: sve_svenetwork[o3p63mi0yc2n5rclvsahz4jou:10.0.0.9/24] INFO Trying to bind inet socket address: /10.0.0.9:5701 INFO Bind successful to inet socket address: /10.0.0.9:5701

There are two extra tasks where container is null (761iwko93k9ni7707ec0rui7v, 8c60hpncgr76thvah50s63pz8) which I don't know from where it comes.

Thanks.

bitsofinfo commented 7 years ago

Not intentional, a bug. Thanks for the report. If you have time, please submit a PR otherwise I'll try to get to it soon