Shorten the expiry window for the work queue SAS URLs assigned at node registration (#416)

The underlying impact is that nodes must re-register on a more frequent basis.

Nodes find out they are out-of-date is during registration and immediately prior to starting a new set of work.  Requiring nodes re-register on a shortened cycle provides more opportunities for nodes to get re-imaged.

Additionally, this addresses an issue handling the SAS URL expiry in a more clean fashion in the supervisor.
This commit is contained in:
bmc-msft
2021-01-07 07:34:26 -05:00
committed by GitHub
parent 3b26ffef65
commit e799eb03cd
5 changed files with 26 additions and 18 deletions

View File

@ -48,11 +48,12 @@ def get_queue_sas(
add: bool = False,
update: bool = False,
process: bool = False,
duration: datetime.timedelta = datetime.timedelta(days=30),
) -> str:
account_id = get_primary_account(storage_type)
logging.debug("getting queue sas %s (account_id: %s)", queue, account_id)
name, key = get_storage_account_name_key(account_id)
expiry = datetime.datetime.utcnow() + datetime.timedelta(days=30)
expiry = datetime.datetime.utcnow() + duration
token = generate_queue_sas(
name,