Giter Site home page Giter Site logo

megacron's People

Contributors

bigfav avatar greg-github avatar johntanner avatar umzegher avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

megacron's Issues

Don't recreate jobs that haven't been modified

Currently megacrontab removes all jobs for the user and creates new ones even if the jobs haven't been modified. The implication of this is that the last_time_run will be changed to the current datetime and the job may not run at the time that the user expects it to. If the interval and command of a job is identical to one that existed previously, then that job should persist in the database.

I don't personally think that we should handle modified jobs because once they are changed they aren't really the same job. The logic to handle this gets quite complicated too. How similar does a job have to be to be considered modified? What if there are multiple jobs that are similar to a previous job?

Add more stats to megacron-status

Right now megacron-status only prints out the number of workers that are up. There are many other useful stats that could be helpful to a user of our system or to us while we are developing it. A few examples that I can think of are:

  • Number of Jobs in queue
  • Number of schedules
  • Number of users with schedules
  • Time the next job is going to run

You should add whatever stats that you think will be useful. If you are not sure you can ask Marc what he thinks.

Allow specifying a user to megacrontab

Add an option to allow editing another user's crontab. For example "megacrontab -u bob" would edit the crontab of the user with the name bob instead of the current user (which should be the default if -u is not specified). Only the root user should be allowed to use this option and if another user tries to use it an error message should be printed and the program should exit (this is how other crontab implementations work). I recommend that you use Python's argparse library to parse the command line options (and provide useful help messages to the user).

Mishandling Jobs

Given the following crontab:

crontab_pic

I run the command:
python edit.py -u crontab.tab

Then I run the scheduler. Next I run two worker threads in separate terminal windows. The jobs should be distributed among the two workers, and they should both print two msgs.

Once the minute comes, one worker correctly prints two msgs:

correct_worker

However, the other worker has odd behavior, as it only prints one msg:

bad_worker1

Then after the refresh time for the worker (10 seconds), it prints the same msg again:

bad_worker2

Given this setup, the bug appears semi-frequently.

The current setup for the bug is complex (multiple workers running, multiple jobs for each worker, and scheduler running). I have not been able to simplify the setup and still get this bug unfortunately, suggesting that it may be a problem with the handling of multiple workers accessing the flat file.

Create unit tests for api.py

We eventually plan on creating multiple api interfaces for different databases and let the user choose which one to use. It will be very important that each of these will work in exactly the same way, so that we don't have bugs that will appear when only using one type of database. We need an extensive set of unit tests that can be run when adding support for new databases.

After creating the tests you should configure setuptools to be able to run the tests by just using the "./setup.py test" command. Also, add a section to the README to let other people know how to run them.

File Naming Issues

If we are going to name our user interface file "crontab" we will have to edit the python file for our crontab reader library since it is named crontab as well. Is this something everyone is willing to do for this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.