多处理池挂起

2024-09-30 16:37:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经创建了一个池来使用Gitpython进行git克隆。有一个巨大的git回购,需要比其他人更多的时间来克隆。每个进程为一个repo执行一个克隆工作。我使用的Pool如下:

multi_res = [p.apply_async(runfunc, args=(incl_info, project_root, skip_dirs,)) 
                for incl_info in incl_infos]
LogInfo('Waiting for all subprocesses done...')
for i in range(len(incl_infos)):
    while not multi_res[i].ready():
        LogInfo("Downloading now")
        time.sleep(5)
p.close()
p.join()

它在大多数情况下工作得很好。但往往会挂在最大的回购。当我单独克隆回购时,它运行良好。所以我想知道pythonmultiprocessing.Pool中是否有块。你知道吗

我已经搜索了被绞死的git克隆过程。git进程输出如下:

Process 27649 attached
read(6, 0x7ffc36dae050, 4)              = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL, si_value={int=2895997, ptr=0x2c307d}} ---
rt_sigreturn()                          = 0
read(6, 0x7ffc36dae050, 4)              = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL, si_value={int=2895997, ptr=0x2c307d}} ---
rt_sigreturn()                          = 0
read(6, 0x7ffc36dae050, 4)              = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL, si_value={int=2895997, ptr=0x2c307d}} ---
rt_sigreturn()                          = 0
read(6, 0x7ffc36dae050, 4)              = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL, si_value={int=2895997, ptr=0x2c307d}} ---
rt_sigreturn()                          = 0

git lfs输出如下:

Process 28006 attached
[ Process PID=28006 runs in 32 bit mode. ]
futex(0x88b982c, FUTEX_WAIT_PRIVATE, 0, NULL

等待你的帮助。你知道吗


Tags: togitreadifissaberestart