File size: 673 Bytes
6b74704
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

import pickle, sys, time
from pathlib import Path

def main():
    pkl = Path(sys.argv[1]); marker = Path(sys.argv[2])
    if marker.exists():
        try: marker.unlink()
        except: pass
    try:
        pool = pickle.load(open(pkl, "rb"))
        print("pool", pool)
        time.sleep(2.0)
        try:
            pool.terminate()
            pool.join()
        except Exception as e:
            print("cleanup", e)
    except Exception as e:
        print("exc", type(e).__name__, e)
        time.sleep(1.0)
    print("FIRED", marker.exists(), marker.stat().st_size if marker.exists() else None)

if __name__ == "__main__":
    main()