Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crontab exorcism #3483

Merged
merged 1 commit into from
Jul 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lib/pbench/cli/server/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,9 @@ def run_gunicorn(server_config: PbenchServerConfig, logger: Logger) -> int:
notifier.notify(f"STATUS=Error initializing database: {exc}")
return 1

# Multiple cron jobs will attempt to file reports with the Elasticsearch
# instance when they start and finish, causing them to all to try to
# initialize the templates in the Indexing sub-system. To avoid race
# conditions that can create stack traces, we initialize the indexing sub-
# system before we start the cron jobs.
# The server and indexer both attempt to initialize the Elasticsearch
# instance, which can cause a race and messy logging. To avoid that,
# initialize the indexing sub-system here.
notifier.notify("STATUS=Initializing Elasticsearch")
logger.info("Performing Elasticsearch indexing setup")
try:
Expand Down
1 change: 0 additions & 1 deletion server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ install-dirs:
${INSTALL} ${INSTALLOPTS} ${DESTDIR}
${INSTALL} ${INSTALLOPTS} ${BINDIR}
${INSTALL} ${INSTALLOPTS} ${LIBDIR}
${INSTALL} ${INSTALLOPTS} ${LIBDIR}/crontab
${INSTALL} ${INSTALLOPTS} ${LIBDIR}/pbench
${INSTALL} ${INSTALLOPTS} ${LIBDIR}/pbench/cli

Expand Down
162 changes: 0 additions & 162 deletions server/bin/pbench-create-crontab

This file was deleted.

22 changes: 0 additions & 22 deletions server/lib/config/pbench-server-default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ workers = 3
# Set the gunicorn worker timeout. Setting it to 0 has the effect of infinite timeouts
worker_timeout = 9000

# Default roles this pbench server takes on, see crontab roles below.
roles = pbench-results

Comment on lines -71 to -73
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto for server/pbenchinacan/etc/pbench-server/pbench-server.cfg?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No: we only define the crontab roles in the default config file. We don't duplicate that in pbench-server.cfg.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. What does this line do?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it's doing the backstroke ... but it's in the wrong pond. 😦

# Optional server environment definition
#environment = staging

Expand Down Expand Up @@ -119,22 +116,3 @@ logging_level = INFO
#logger_port = 514
# "log_dir" is only considered when "logger_type" is set to "file".
#log_dir =

###########################################################################
# crontab roles
[pbench-results]
user = %(default-user)s
mailfrom = %(user)s@localhost
tasks = pbench-index, pbench-re-index

###########################################################################
# crontab tasks

[pbench-index]
crontab = * * * * * flock -n %(lock-dir)s/pbench-index.lock %(script-dir)s/pbench-index

[pbench-re-index]
crontab = * * * * * flock -n %(lock-dir)s/pbench-re-index.lock %(script-dir)s/pbench-index --re-index

[pbench-index-tool-data]
crontab = * * * * * flock -n %(lock-dir)s/pbench-index-tool-data.lock %(script-dir)s/pbench-index --tool-data
2 changes: 1 addition & 1 deletion server/lib/systemd/pbench-index.timer
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Description=Pbench Server indexer timer
After=pbench-server.service
Requires=pbench-index.service
BindsTo=pbench-server.service

[Timer]
Unit=pbench-index.service
Expand All @@ -10,4 +11,3 @@ OnCalendar=*-*-* *:*:15

[Install]
WantedBy=timers.target
BindsTo=pbench-server.service