Hi,
I'm not from the PyPSA team, so take my advice with a grain of salt.
I think I've seen something similar. FOr relatively large models (many components and/or long optimisation times), I also noticed that the optimisation never finishes, even though the CBC or GLPSOL process loads drop to zero in Task Manager (I'm working in Windows 10).
What I found is that in the function pypsa/linopt/run_and_read_glpk(), the line "result.wait()" just hangs, even after the corresponding subprocess appears to the done as its CPU load drops to zero in Task Manager. My second finding was that if I ran the same problem directly from command line, it worked fine. After this I saw that in the log file produced during the PyPSA call, the file simply stopped updating at some point during the run. It all comes back to stdout (which is set to subprocess.PIPE in the implementation) saturates during the wait. I can't quite remember how I fixed the issue, since I have since upgraded the pypsa package and started using the HiGHS solver, rather than GLPK, and I don't have the hang problem there. But it involves increasing the subprocess bufsize and/or reading the stdout stream to avoid it filling up.
All the best,
Jonas