Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Cleaning up old failed tasks? #49

Open
naemono opened this issue Dec 15, 2015 · 2 comments
Open

Cleaning up old failed tasks? #49

naemono opened this issue Dec 15, 2015 · 2 comments

Comments

@naemono
Copy link
Contributor

naemono commented Dec 15, 2015

This is more of a question than an issue.

i was wondering why I was getting duplicative service ids for the same service, even though it was an old deployment of the service.

from here:

https://github.com/CiscoCloud/mesos-consul/blob/master/mesos/mesos.go#L150-L158

It appears that only running tasks are investigated.

I'm seeing this in my setup:

http://myhost:8500/v1/catalog/service/nginx-test
[
{"Node":"iadmesos1.here.com","Address":"10.57.128.114","ServiceID":"mesos-consul:10.57.128.114:nginx-test:31678","ServiceName":"nginx-test","ServiceTags":["nginx-test","mmontgomery","dev"],"ServiceAddress":"192.168.200.2","ServicePort":31678,"ServiceEnableTagOverride":false,"CreateIndex":1330,"ModifyIndex":1330},
{"Node":"iadmesos1.here.com","Address":"10.57.128.114","ServiceID":"mesos-consul:10.57.128.114:nginx-test:31679","ServiceName":"nginx-test","ServiceTags":["nginx-test","mmontgomery","dev"],"ServiceAddress":"192.168.200.2","ServicePort":31679,"ServiceEnableTagOverride":false,"CreateIndex":1331,"ModifyIndex":1331},
{"Node":"iadmesos1.here.com","Address":"10.57.128.114","ServiceID":"mesos-consul:10.57.128.114:nginx-test:31889","ServiceName":"nginx-test","ServiceTags":["nginx-test","mmontgomery","dev"],"ServiceAddress":"192.168.200.4","ServicePort":31889,"ServiceEnableTagOverride":false,"CreateIndex":1108,"ModifyIndex":1108},
{"Node":"iadmesos1.here.com","Address":"10.57.128.114","ServiceID":"mesos-consul:10.57.128.114:nginx-test:31890","ServiceName":"nginx-test","ServiceTags":["nginx-test","mmontgomery","dev"],"ServiceAddress":"192.168.200.4","ServicePort":31890,"ServiceEnableTagOverride":false,"CreateIndex":1109,"ModifyIndex":1109},
{"Node":"iadmesos1.here.com","Address":"10.57.128.114","ServiceID":"mesos-consul:10.57.128.114:nginx-test:31902","ServiceName":"nginx-test","ServiceTags":[],"ServiceAddress":"192.168.200.3","ServicePort":31902,"ServiceEnableTagOverride":false,"CreateIndex":1043,"ModifyIndex":1043},
{"Node":"iadmesos1.here.com","Address":"10.57.128.114","ServiceID":"mesos-consul:10.57.128.114:nginx-test:31903","ServiceName":"nginx-test","ServiceTags":[],"ServiceAddress":"192.168.200.3","ServicePort":31903,"ServiceEnableTagOverride":false,"CreateIndex":1044,"ModifyIndex":1044}
]

Only one of these tasks is actually active.

Does de-registration not remove these?

Thanks for any further insight you can give.

@naemono
Copy link
Contributor Author

naemono commented Dec 16, 2015

Ok, digging through the code this morning, I think I've found the issue.

Here:

https://github.com/CiscoCloud/mesos-consul/blob/master/mesos/mesos.go#L161

You're not checking if an error was returned from m.Registry.Deregister()

This seems more appropriate:

    // Remove completed tasks
    err := m.Registry.Deregister()
    if err != nil {
        log.Error(err)
    }

I'll get a PR for this shortly.

@scalp42
Copy link

scalp42 commented Dec 24, 2015

@naemono any chance for the PR ? 🎄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants