route bake targets across pods with random loadbalance#3861
route bake targets across pods with random loadbalance#3861areebahmeddd wants to merge 1 commit into
Conversation
What about loadbalance=sticky ? |
|
Also, please squash the commits |
no change. it reuses the same shared connection path
sure 🙂 |
fb5e0c0 to
1050ee5
Compare
crazy-max
left a comment
There was a problem hiding this comment.
I was looking at
buildx/driver/kubernetes/podchooser/podchooser.go
Lines 29 to 45 in 0b358c7
Seems to still looks capable of picking the same pod for all targets in one bake no? ChoosePod() creates a new RNG on every call and seeds it with time.Now().Unix(). With this PR, multiple targets can create fresh clients and dial within the same second, so each call can get the same seed and produce the same first random value iiuc.
Maybe we should seed the RNG once at the package level, with concurrency handled, or use another safe random selection path? Otherwise this PR may still reproduce the original issue.
|
Hm, let me take a look |
61d1cb4 to
1a82b23
Compare
|
gentle ping! @crazy-max @AkihiroSuda 🙂 |
|
5a469b8 to
279ddda
Compare
|
ah yes, done : ) |
279ddda to
c514723
Compare
Signed-off-by: Areeb Ahmed <areebahmed0709@gmail.com>
c514723 to
ec41ad7
Compare
loadbalance=randomon the kubernetes driver was sending all bake targets to the same pod.the client connection was cached after the first dial, so pod selection only happened once.
fix this by creating a new connection per target when
loadbalance=randomis enabled.also disable the shared local mount session optimization in this mode.
Closes #3382