Repository navigation
worker: add fallback to ATC streaming when P2P fails - #9390
Conversation
When P2P volume streaming fails (e.g., workers on different networks), automatically fall back to streaming through the ATC web node. This enables you to use the enable-p2p-volume-streaming event if nodes are not on the same network. Adds structured logging and a new metric volumes_streamed_via_fallback for observability. Related to concourse#7017 Signed-off-by: Kurt McAlpine <[email protected]>
| err := s.p2pStream(ctx, p2pSrc, p2pDst) | ||
| if err != nil { | ||
| // P2P streaming failed - fallback to streaming through ATC (web node) | ||
| logger.Info("p2p-stream-failed-falling-back-to-atc", lager.Data{ |
There was a problem hiding this comment.
info level seems rather low, warn or error seem more appropriate IMO
|
This is super cool! Thanks for the PR, I'm excited to review it. and THANK YOU for the very detailed steps to locally test and verify 👏 Saving me a bunch of time there! |
taylorsilva
left a comment
There was a problem hiding this comment.
This looks good! I would change the logger level from info to error. Otherwise this works wonderfully.
I tested using this pipeline and a similar docker-compose.yml as what you used:
pipeline.yml
resources:
- name: mock
type: mock
tags: [network-a]
jobs:
- name: job
plan:
- get: mock
tags: [network-a]
- put: mock
no_get: true
tags: [network-b]
params:
file: mock/versionI thought "maybe it would be nice to let the users know the initial P2P streaming failed", but realized we don't have a convenient way to communicate this back to the web node to log. Also thought that might be too noisy for users anyways. It does suck that volume streaming will appear to take longer than usual since we have to wait for the timeout to occur.
Co-authored-by: Taylor Silva <[email protected]>
|
@taylorsilva Hey Taylor, I'm one of Kurt's coworkers and just letting you know that he's on vacation for a week or two so don't be surprised if he doesn't reply for a little bit. He gave us a heads up about this PR before he left 😄 |
taylorsilva
left a comment
There was a problem hiding this comment.
LGTM - Thanks again for this PR!
|
@marcus-crane Thanks for letting me know. Thankfully he resolved the one thing that needed changing before he left :) Enjoy your time off @kurtmc |



Changes proposed by this PR
Related to #7017
This PR implements an improvement for volume streaming by adding automatic fallback to ATC (web node) streaming when P2P streaming fails.
Key changes:
volumes_streamed_via_fallbackto track fallback usage for observabilityRationale:
I want to be able to run a small number of nodes in a different network and still have the majority of the nodes run in a seperate network and use p2p for peformance reasons.
Notes to reviewer
Release Note
Volume streaming now automatically falls back to streaming through the web node when peer-to-peer streaming fails. This makes the
enable-p2p-volume-streamingflag more resilient in environments where workers may be on different networks.