Skip to content

After a resume with a new public IP, ready-url (no DNS name) and plugin {{ instance.ip }} still carry the old IP #1019

Closed

Description

@scttfrdmn

Found while fixing #987 (PR #1020). Verified by reading pkg/agent, not reproduced on an instance.

#987 makes spored re-read the public IP after a resume from hibernation and re-register DNS with it. These other users of the boot-time IP still have the old one:

  1. spawn:ready-url for DCV and web apps on an instance with no DNS name. maybeSetupDCVAuth and maybeSetupWebReady build the URL from the public IP when DNSName is empty. They write it once (dcvAuthDone / webReadyDone), so after a resume the tag points at the old IP. With a DNS name the URL is the FQDN, which After a resume from hibernation spored carries its pre-hibernate state: no pre-stop hook on the next stop, no DNS name, and the idle timer already expired #987 keeps current.
  2. {{ instance.ip }} in plugin templates. pluginruntime.Runtime holds the boot-time *provider.Identity, so a health step, or a step run after the resume, renders the old IP.
  3. No DNS client when the first boot had no public IP. newAgent creates dnsClient only when identity.PublicIP != "". If the IP appears later, refreshDNSLease and the After a resume from hibernation spored carries its pre-hibernate state: no pre-stop hook on the next stop, no DNS name, and the idle timer already expired #987 resume path have nothing to register with. This is rare: the IP would have to appear after boot.

Suggested fix: after a resume, re-run the ready-url write with the current IP (clear webReadyDone, and dcvAuthDone once the token is kept), and give the plugin runtime the IP through a getter rather than the identity snapshot. For (3), create the DNS client lazily in refreshDNSLease.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions