Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Add configurable timeout to run db script #1550

Merged
merged 2 commits into from
Apr 17, 2021

Conversation

jkosh44
Copy link
Contributor

@jkosh44 jkosh44 commented Apr 17, 2021

Description

When running the database through our python scripts there is a hardcoded timeout of 600 seconds. After waiting for the DB to startup for 600 seconds the script times out and returns an error.

I think for some use cases 10 minutes is a bit excessive to wait and we may want to timeout much sooner. To solve this I added an optional timeout parameter that defaults to 600 seconds. All existing scripts will be unchanged, but those in the future who want to set a smaller timeout can do that.

Sorry for the formatting changes, I format all the files I'm working on out of habit. If it's an issue I can go through and revert all the formatting changes.

@jkosh44 jkosh44 self-assigned this Apr 17, 2021
@jkosh44 jkosh44 added feature Adds a requested feature ready-for-ci Indicate that this build should be run through CI. ready-for-review This PR passes all checks and is ready to be reviewed. Mark PRs with this. labels Apr 17, 2021
Copy link
Contributor

@lmwnshn lmwnshn left a comment

Choose a reason for hiding this comment

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

I'm OK with merging it since it isn't changing anything in CI (see [0]), but it doesn't seem like you're adding a command line flag or something for it either

[0] #1494

@jkosh44
Copy link
Contributor Author

jkosh44 commented Apr 17, 2021

I'm OK with merging it since it isn't changing anything in CI (see [0]), but it doesn't seem like you're adding a command line flag or something for it either

[0] #1494

When you say I'm not adding a command line flag do you mean for a specific script or just all the CI scripts in general that use this file? I think this utility file is used by multiple different scripts each with their own command line arguments. For example the OLTP scripts have their own command line arguments and use this file to start the DB, and the replication scripts have their own command line arguments and use this file to start the DB.

For those scripts I don't know if making a configurable timeout would be that useful especially since they're mainly run by Jenkins where they don't need to be babysat and we'd rather not have false negatives. However other scripts can have different timeouts especially if they aren't meant to be run by Jenkins and someone is running them manually.

In general, I think the value of this PR is not to allow a single script to have a configurable timeout, but to allow multiple different scripts to have different timeouts from each other. Of course if someone thinks it's useful they can now also add a configurable timeout to a single script.

EDIT: Just to add some actual context for my use case. I'm using this file to start the DB in my scripts that test for log throughput, and I'm running my scripts manually on dev machines. The DB has always started or errored out within 30-60 seconds. I'd rather have the tests fail fast so I can see the error without having to wait 10 minutes each time, even if I risk getting a false negative every once in awhile.

Copy link
Contributor

@lmwnshn lmwnshn left a comment

Choose a reason for hiding this comment

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

LGTM

@lmwnshn
Copy link
Contributor

lmwnshn commented Apr 17, 2021

Sounds good to me

@lmwnshn lmwnshn merged commit df920d6 into cmu-db:master Apr 17, 2021
@jkosh44 jkosh44 deleted the db-run-timeout branch April 27, 2021 13:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Adds a requested feature ready-for-ci Indicate that this build should be run through CI. ready-for-review This PR passes all checks and is ready to be reviewed. Mark PRs with this.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants