fix signal handling and ensure workers process tasks and then restart