• Kirill Smelkov's avatar
    X wcfs: Teach join/serve to start successfully even after unclean wcfs shutdown · b0ca031f
    Kirill Smelkov authored
    Before this patch, after `xslapos node stop wcfs`, `xslapos node start wcfs`
    was failing in a sense that started service was turning into EXITED state
    with something like the following in its log:
    
        wcfs: 2021/05/31 15:28:15 zodb: FIXME: open zeo://10.0.82.110:2100?storage=root: raw cache is not ready for invalidations -> NoCache forced
        Traceback (most recent call last):
          File "/srv/slapgrid/slappart34/srv/runner/software/44fe7dd3f13ecd100894c6368a35c055/bin/wcfs", line 290, in <module>
            sys.exit(wendelin.wcfs.main())
          File "<decorator-gen-7>", line 2, in main
          File "/srv/slapgrid/slappart34/srv/runner/software/44fe7dd3f13ecd100894c6368a35c055/develop-eggs/pygolang-0.0.8-py2.7-linux-x86_64.egg/golang/__init__.py", line 103, in _
            return f(*argv, **kw)
          File "/srv/slapgrid/slappart34/srv/runner/software/44fe7dd3f13ecd100894c6368a35c055/parts/wendelin.core/wcfs/__init__.py", line 409, in main
            serve(zurl, optv, exec_=True)
          File "/srv/slapgrid/slappart34/srv/runner/software/44fe7dd3f13ecd100894c6368a35c055/parts/wendelin.core/wcfs/__init__.py", line 365, in serve
            f = open(mntpt + "/.wcfs/zurl")
        IOError: [Errno 107] Transport endpoint is not connected: '/dev/shm/wcfs/c63ef16eb2e74dc62cabf8ffc11798fd42d0158a/.wcfs/zurl'
    
    That's because when wcfs is killed (xslapos node stop), it is only filesystem
    server process that is terminated, but the FUSE mount and connection remains
    registered on the system, and any access to FUSE filesystem with exited/crashed
    server returns that "Transport endpoint is not connected" error.
    
    -> Fix that by detecting at wcfs start whether it was previous unclean wcfs
    shutdown, and then pre-clean things as necessary.
    b0ca031f
__init__.py 14.3 KB