[why] when there is only a few repo files in upstream-repos, that means the same repo will be called very frequently. As the main loop is too fast, it seems the new flow would be called before the last flow of the same repo end completely. That cause a memory problem.
put a sleep in main loop would give the flow enough time to end completely before the same flow be called again
Signed-off-by: Li Yuanchao lyc163mail@163.com --- lib/git_mirror.rb | 1 + 1 file changed, 1 insertion(+)
diff --git a/lib/git_mirror.rb b/lib/git_mirror.rb index 72ca328..5b6b889 100644 --- a/lib/git_mirror.rb +++ b/lib/git_mirror.rb @@ -203,6 +203,7 @@ class MirrorMain push_git_queue handle_feedback Signal.trap(:SIGCHLD, 'SIG_IGN') + sleep(0.1) end end end
On Tue, Nov 17, 2020 at 10:07:38AM +0800, Li Yuanchao wrote:
[why] when there is only a few repo files in upstream-repos, that means the same repo will be called very frequently. As the main loop is too fast, it seems the new flow would be called before the last flow of the same repo end completely. That cause a memory problem.
put a sleep in main loop would give the flow enough time to end completely before the same flow be called again
I think add a sleep(0.1) can't solve your problem, need to find the root cause.
Thanks, Xueliang
Signed-off-by: Li Yuanchao lyc163mail@163.com
lib/git_mirror.rb | 1 + 1 file changed, 1 insertion(+)
diff --git a/lib/git_mirror.rb b/lib/git_mirror.rb index 72ca328..5b6b889 100644 --- a/lib/git_mirror.rb +++ b/lib/git_mirror.rb @@ -203,6 +203,7 @@ class MirrorMain push_git_queue handle_feedback Signal.trap(:SIGCHLD, 'SIG_IGN')
end endsleep(0.1)
end
2.23.0
git_mirror 的POLL interval控制策略,有文档吗 - 现状是什么? - 理想解决方案是什么?
Thanks, Fengguang
On Tue, Nov 17, 2020 at 10:07:38AM +0800, Li Yuanchao wrote:
[why] when there is only a few repo files in upstream-repos, that means the same repo will be called very frequently. As the main loop is too fast, it seems the new flow would be called before the last flow of the same repo end completely. That cause a memory problem.
put a sleep in main loop would give the flow enough time to end completely before the same flow be called again
Signed-off-by: Li Yuanchao lyc163mail@163.com
lib/git_mirror.rb | 1 + 1 file changed, 1 insertion(+)
diff --git a/lib/git_mirror.rb b/lib/git_mirror.rb index 72ca328..5b6b889 100644 --- a/lib/git_mirror.rb +++ b/lib/git_mirror.rb @@ -203,6 +203,7 @@ class MirrorMain push_git_queue handle_feedback Signal.trap(:SIGCHLD, 'SIG_IGN')
end endsleep(0.1)
end
2.23.0