Skip to content
This repository has been archived by the owner on May 29, 2023. It is now read-only.

关于多个worker同步upstream更新信息失败的问题 #132

Open
huhaipeng opened this issue Oct 10, 2019 · 7 comments
Open

关于多个worker同步upstream更新信息失败的问题 #132

huhaipeng opened this issue Oct 10, 2019 · 7 comments

Comments

@huhaipeng
Copy link

看了代码,在更新upstream信息时是其中一个worker先主动更新,其他worker从共享内存处获取msg来同步更新upstream。若其中某些worker更新信息失败,造成不一致,应该怎么解决?我见代码里没有相应的解决方法。

@huhaipeng
Copy link
Author

@yzprofile @chobits 大佬们可以解答一下小弟的疑惑嘛?

@jhseodev
Copy link

jhseodev commented Jul 31, 2020

this module do not work normally when has worker processes more than two.
i want to know when will be updated.

@LucienCheng
Copy link

这个问题在多核多worker下出现了同步的问题,请问这个怎么解决呀~~~

@huhaipeng
Copy link
Author

这个问题在多核多worker下出现了同步的问题,请问这个怎么解决呀~~~

你说的同步问题具体是什么问题?具体是怎么造成的?其实程序正常运行的情况下应该是不会出现同步的问题的吧,感觉和多核无关。

@huhaipeng
Copy link
Author

this module do not work normally when has worker processes more than two.
i want to know when will be updated.

I test this module with multiple worker processes but nerver found any problems.So what is your specified problem ?

@jhseodev
Copy link

@huhaipeng
I'm using zone in upstream context as follow.

upstream my_ups {
  ...
  server ... ;
  zone ...;
  ...
}

location my_loc {
  ...
  set $dyups my_ups;
  proxy_pass http://$dyups;
  ...
}

When updating themy_ups upstream context, a new upstream context is created but zone is not initialized.
One worker process that received request is updated and the others are not updated.
This is what I have checked so far.

Please let me know if I am misunderstanding.
Thank for comment.

@dzhcool
Copy link

dzhcool commented Nov 16, 2020

可以考虑在init_worker阶段给每个worker写个定时器,在定时器中处理upstream更新。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants