-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ttl for node status. #624
Conversation
@r0h4n @shtripat @anivargi @nthomas-redhat Please review |
NOTE: This patch is dependent on: Tendrl/commons#738. So please merge this only after merging above patch |
a991a36
to
7d89c11
Compare
@@ -29,12 +29,12 @@ def _run(self): | |||
current_tags += ["tendrl/node_%s" % NS.node_context.node_id] | |||
NS.node_context.tags = list(set(current_tags)) | |||
NS.node_context.save() | |||
|
|||
SYNC_TTL = int(NS.config.data.get("sync_interval", 10)) + 250 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest you add 100 instead of 250
Also, SYNC_TTL should be _sync_ttl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
7d89c11
to
7370542
Compare
|
||
sync_disks_thread = gevent.spawn(disk_sync.sync) | ||
sync_disks_thread.join() | ||
|
||
sync_networks_thread = gevent.spawn(network_sync.sync) | ||
sync_networks_thread.join() | ||
|
||
if "tendrl/monitor" in NS.node_context.tags: | ||
update_node_status_thread = gevent.spawn( | ||
node_status_update.update) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of node_status_update.update
call it "check_all_managed_nodes_status.run()"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
NS._int.client.read( | ||
"/nodes/{0}/NodeContext/status".format(node_id) | ||
) | ||
except etcd.EtcdKeyNotFound: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This read and then write is not atomic
use
NS._int.wclient.write(integration_index_key, |
instead of reading and then writing, catch etcd.EtcdAlreadyExist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
This patch adds ttl fol node status . If the node goes down due to any reason, the status attribute will vanish after some time. Thus API layer can get to know that node is down and mark it accordingly. tendrl-bug-id: Tendrl#592 Signed-off-by: nnDarshan <darshan.n.2024@gmail.com>
7370542
to
f484bac
Compare
This patch adds heartbeat updation during node sync.
If the node goes down due to any reason, the heart
beat object will vanish after some time. Thus API
layer can get to know that node is down and mark it
accordingly.
tendrl-bug-id: #592
Signed-off-by: nnDarshan darshan.n.2024@gmail.com