mesos / mesos-go

Go language bindings for Apache Mesos
Apache License 2.0
544 stars 146 forks source link

feature flag opt-in for re-subscribe #337

Closed rboyer closed 6 years ago

rboyer commented 6 years ago

I noticed that the v1 scheduler workflow isn't re-subscribe friendly, which makes implementing proper heartbeat handling in a framework tricky.

This PR adds the bare minimum hooks necessary to test out re-SUBSCRIBE on an opt-in basis. It "should" be safe to do without the feature-flag, but the comments by jdef in the source imply otherwise.

Doing this without the opt-in does have repercussions on anyone who is currently invoking a SUBSCRIBE call. To avoid issues with receiving one last scheduler.Event_ERROR message on the old subscription socket, you have to do some additional state tracking in framework code to correctly handle it. As I'm not using the helpers in the extras directory, I'm not sure the right way to handle the workflow there so I didn't make any changes to try and use the re-subscribe changes there.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.2%) to 58.197% when pulling 5212e881dd1ad9994a05d2c43b98c6c05274c25a on rboyer:resubscribe into c488712c2b5a908fc9534560386fc572c3d126bf on mesos:master.

jdef commented 6 years ago

Thanks for this PR! The scheduler not receiving heartbeat signals from the master is a good example of a condition not picked up by the default error detection in the httpsched impl.

jdef commented 6 years ago

255 #277