{"action":"created","issue":{"url":"https://api.github.com/repos/vert-x3/vertx-service-discovery/issues/96","repository_url":"https://api.github.com/repos/vert-x3/vertx-service-discovery","labels_url":"https://api.github.com/repos/vert-x3/vertx-service-discovery/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/vert-x3/vertx-service-discovery/issues/96/comments","events_url":"https://api.github.com/repos/vert-x3/vertx-service-discovery/issues/96/events","html_url":"https://github.com/vert-x3/vertx-service-discovery/issues/96","id":376859241,"node_id":"MDU6SXNzdWUzNzY4NTkyNDE=","number":96,"title":"KubernetesServiceImporter: Record is not unpublished if removed as result of MODIFIED event","user":{"login":"daka1510","id":16404496,"node_id":"MDQ6VXNlcjE2NDA0NDk2","avatar_url":"https://avatars3.githubusercontent.com/u/16404496?v=4","gravatar_id":"","url":"https://api.github.com/users/daka1510","html_url":"https://github.com/daka1510","followers_url":"https://api.github.com/users/daka1510/followers","following_url":"https://api.github.com/users/daka1510/following{/other_user}","gists_url":"https://api.github.com/users/daka1510/gists{/gist_id}","starred_url":"https://api.github.com/users/daka1510/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daka1510/subscriptions","organizations_url":"https://api.github.com/users/daka1510/orgs","repos_url":"https://api.github.com/users/daka1510/repos","events_url":"https://api.github.com/users/daka1510/events{/privacy}","received_events_url":"https://api.github.com/users/daka1510/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-11-02T15:32:50Z","updated_at":"2018-11-03T07:43:15Z","closed_at":null,"author_association":"NONE","body":"**Reproduction:**\r\n- deploy a service (e.g. hello-world) that uses the `KubernetesServiceImporter`\r\n- deploy another service (e.g. hello-minikube) in the same namespace\r\n- delete the second service and observe the received updates (`KubernetesServiceImporter#onChunk`):\r\n```\r\nMODIFIED Event:\r\n{\r\n  \"location\": {\r\n    \"endpoint\": \"http://10.98.7.139:8080\",\r\n    \"host\": \"10.98.7.139\",\r\n    \"port\": 8080,\r\n    \"root\": \"\",\r\n    \"ssl\": false\r\n  },\r\n  \"metadata\": {\r\n    \"run\": \"hello-minikube\",\r\n    \"kubernetes.namespace\": \"default\",\r\n    \"kubernetes.name\": \"hello-minikube\",\r\n    \"kubernetes.uuid\": \"37c57c1e-deb0-11e8-a8ee-0800274f8294\"\r\n  },\r\n  \"name\": \"hello-minikube\",\r\n  \"status\": \"UNKNOWN\",\r\n  \"type\": \"http-endpoint\"\r\n}\r\n\r\n\r\nDELETED Event:\r\n{\r\n  \"location\": {\r\n    \"endpoint\": \"http://10.98.7.139:8080\",\r\n    \"host\": \"10.98.7.139\",\r\n    \"port\": 8080,\r\n    \"root\": \"\",\r\n    \"ssl\": false\r\n  },\r\n  \"metadata\": {\r\n    \"run\": \"hello-minikube\",\r\n    \"kubernetes.namespace\": \"default\",\r\n    \"kubernetes.name\": \"hello-minikube\",\r\n    \"kubernetes.uuid\": \"37c57c1e-deb0-11e8-a8ee-0800274f8294\"\r\n  },\r\n  \"name\": \"hello-minikube\",\r\n  \"status\": \"UNKNOWN\",\r\n  \"type\": \"http-endpoint\"\r\n}\r\n```\r\n\r\n**Issue**\r\n- The Record (here: http://10.98.7.139:8080 // 37c57c1e-deb0-11e8-a8ee-0800274f8294) is deleted but `KubernetesServiceImporter.java#unpublishRecord` is never invoked. Consequence: the service is still available via service discovery APIs.\r\n\r\n**Root Cause**\r\n- as result of the `MODIFIED` event the storedRecord gets removed (https://github.com/vert-x3/vertx-service-discovery/blob/master/vertx-service-discovery-bridge-kubernetes/src/main/java/io/vertx/servicediscovery/kubernetes/KubernetesServiceImporter.java#L271) \r\n- when the `DELETE` event is processed shortly after, no storedRecord is found and therefore https://github.com/vert-x3/vertx-service-discovery/blob/master/vertx-service-discovery-bridge-kubernetes/src/main/java/io/vertx/servicediscovery/kubernetes/KubernetesServiceImporter.java#L265 is never called "},"comment":{"url":"https://api.github.com/repos/vert-x3/vertx-service-discovery/issues/comments/435568035","html_url":"https://github.com/vert-x3/vertx-service-discovery/issues/96#issuecomment-435568035","issue_url":"https://api.github.com/repos/vert-x3/vertx-service-discovery/issues/96","id":435568035,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNTU2ODAzNQ==","user":{"login":"cescoffier","id":402301,"node_id":"MDQ6VXNlcjQwMjMwMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/402301?v=4","gravatar_id":"","url":"https://api.github.com/users/cescoffier","html_url":"https://github.com/cescoffier","followers_url":"https://api.github.com/users/cescoffier/followers","following_url":"https://api.github.com/users/cescoffier/following{/other_user}","gists_url":"https://api.github.com/users/cescoffier/gists{/gist_id}","starred_url":"https://api.github.com/users/cescoffier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cescoffier/subscriptions","organizations_url":"https://api.github.com/users/cescoffier/orgs","repos_url":"https://api.github.com/users/cescoffier/repos","events_url":"https://api.github.com/users/cescoffier/events{/privacy}","received_events_url":"https://api.github.com/users/cescoffier/received_events","type":"User","site_admin":false},"created_at":"2018-11-03T07:43:15Z","updated_at":"2018-11-03T07:43:15Z","author_association":"MEMBER","body":"PR: https://github.com/vert-x3/vertx-service-discovery/pull/97."}}
{"actor":{"display_login":"cescoffier"}}