erlware / resource_discovery

An application used to dynamically discover resources present in an Erlang node cluster.
erlware.org
MIT License
101 stars 38 forks source link

Heartbit doesn't delete resources #12

Open netDalek opened 9 years ago

netDalek commented 9 years ago

I probably just can't understand the rigth behaviour, but I don't know the better way to ask. May be this question will help smb.

I start two nodes with resource_discovery application (with heartbit). Run on the first:

resource_discovery:add_local_resource_tuple({worker, a}).
resource_discovery:sync_resources().

And run on the second:

resource_discovery:add_target_resource_types([worker]).
resource_discovery:sync_resources().
resource_discovery:get_resources(worker). #[a]

And get the resource. It's OK. Then I kill first node. But I still get registered resource, calling resource_discovery:get_resources(worker). Calling sync_resources and contract_nodes doesn't help. Should it disappeared? Where is my mistake?

ericbmerritt commented 9 years ago

@martinjlogan thoughts

martinjlogan commented 9 years ago

It should not. Heartbeat is not a one sized fits all fit for understanding if a resource is there or not. All the heartbeat does is rejoin a cluster if it gets separated for some reason. Honestly, at this point I question whether hearbeat is even a good feature or something that should be implemented at the application level or at least a higher level than RD. I am open to dissenting ideas though.

On Wed, Apr 1, 2015 at 6:17 PM, Eric Merritt notifications@github.com wrote:

@martinjlogan https://github.com/martinjlogan thoughts

— Reply to this email directly or view it on GitHub https://github.com/erlware/resource_discovery/issues/12#issuecomment-88661605 .

Martin Logan Erlang & OTP in Action (Manning) http://manning.com/logan http://twitter.com/martinjlogan http://erlware.org