Portainer Edge Agent stack deploy idempotency during network partition retries
0 reputation · 20 Aug 2024, 15:37 UTC
0 reputation · 20 Aug 2024, 15:37 UTC
Portainer Edge Agents maintain a persistent WebSocket connection to the Portainer Server with exponential backoff retries (default 5s, configurable via EDGE_AGENT_RETRY_INTERVAL). When the Server dispatches a stack deployment and the acknowledgment is lost due to a network partition, the Server re-sends the command on reconnect.
The Edge Agent does not implement idempotency keys for stack deployments. If the first deployment attempt partially succeeded (e.g., images pulled, some containers created) before the partition, the retry will re-execute the same deployment, potentially creating duplicate resources such as named volumes with fixed names or causing container name conflicts.
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.