kragniz / kragniz/python-etcd3

How to "keep-alive" by lease_id?

Open
#2,409 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
450
Forks
194
PR merge metrics
No merged PRs in 30d

Description

Hi,

I am trying to find a way how can i extend TTL for lease by having its id only (not a whole object)? Lets say i have a script which will create lease:
```
import etcd3
etcd = etcd3.client()
etcd.lease(50, lease_id=123)
```

And i have another script which i like to refresh the leases only, without [re]creating it:
```
import etcd3
etcd = etcd3.client()
etcd.refresh_lease(lease_id=123) # or smth
```

Similar functionality like `etcdctl` has, so i can run keep-alive independently from another script:
```
# etcdctl lease grant 60
lease 42d78d9df80a26ab granted with TTL(60s)
# etcdctl lease keep-alive 42d78d9df80a26ab --once
lease 42d78d9df80a26ab keepalived with TTL(60)
```

Is there a way with `etcd3` module extend lease when it is already created by another process or script ?

Thanks

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Start by examining the existing etcd3 lease and refresh_lease APIs and comparing them with the etcdctl lease keep-alive behavior described here. Done means a separate process can refresh an existing lease using only its lease_id, without recreating it.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.