josiahcarlson / jobs Goto Github PK
View Code? Open in Web Editor NEWJob input/output control with Redis
License: GNU Lesser General Public License v2.1
Job input/output control with Redis
License: GNU Lesser General Public License v2.1
Deprecation warnings are raised due to invalid escape sequences. This can be fixed by using raw strings or escaping the literals.
find . -iname '*.py' | grep -v example | xargs -P 4 -I{} python3.8 -Wall -m py_compile {}./jobs.py:282: DeprecationWarning: invalid escape sequence \d
TS_RE = re.compile('^(\d{9,}(?:[.]\d*)?)$')
./jobs.py:283: DeprecationWarning: invalid escape sequence \d
DT_RE = re.compile('^(\d{4})-(\d{2})-(\d{2})(?: (\d{2}):(\d{2})(?::(\d{2})(?:[.](?:\d+)?)?)?)?$')
I've seen some silent errors recently and after some shotgun debugging I ended up with the below minimal example:
import os
import signal
import threading
import time
#import jobs
def selfkill():
time.sleep(5)
os.kill(os.getpid(), signal.SIGTERM)
x = threading.Thread(target=selfkill)
x.start()
time.sleep(10)
print('OK')
This will of course stop after 5 seconds with exit code ~143 or so, but if commenting out import jobs
, it will exit without an error and exic code 0 :thinking_face:
I suspect this is happening because of https://github.com/josiahcarlson/jobs/blob/master/jobs.py#L323
I am not quite sure about the background and why we need to override the signal handler -- can you please help me understand what I am doing wrong or some pointers on how to fix this? In short, I want the above job (after uncommenting import jobs
) to fail due to the SIGTERM
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.