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

Add input validation for cli tool #236

Merged
merged 3 commits into from
Jun 27, 2017
Merged

Add input validation for cli tool #236

merged 3 commits into from
Jun 27, 2017

Conversation

hiboyang
Copy link
Contributor

No description provided.

@hiboyang hiboyang requested review from datoug and kirg June 26, 2017 23:24
@coveralls
Copy link

coveralls commented Jun 26, 2017

Coverage Status

Coverage increased (+0.06%) to 68.628% when pulling 58e7b37 on validate_input into 9732c72 on master.

// MinConsumedMessagesRetention is the minimum consumed retention
MinConsumedMessagesRetention = 60
// MaxConsumedMessagesRetention is the maximum consumed retention
MaxConsumedMessagesRetention = 100 * 24 * 3600
Copy link
Contributor

Choose a reason for hiding this comment

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

I think 100 days is too long, maybe change to 30 days?

Copy link
Contributor

Choose a reason for hiding this comment

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

same for unconsumed retention

// MaxUnconsumedMessagesRetention is the maximum unconsumed retention
MaxUnconsumedMessagesRetention = 100 * 24 * 3600
// MinLockTimeoutSeconds is the minimum lock timeout seconds
MinLockTimeoutSeconds = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

too short? maybe 5 seconds

// MinLockTimeoutSeconds is the minimum lock timeout seconds
MinLockTimeoutSeconds = 0
// MaxLockTimeoutSeconds is the maximum lock timeout seconds
MaxLockTimeoutSeconds = 100 * 24 * 3600
Copy link
Contributor

Choose a reason for hiding this comment

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

This would be too long. I think generally lock timeout is in seconds. Maybe 1hr is more than enough

// MaxLockTimeoutSeconds is the maximum lock timeout seconds
MaxLockTimeoutSeconds = 100 * 24 * 3600
// MinMaxDeliveryCount is the minimum value for max delivery count
MinMaxDeliveryCount = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

min is 1

// MinMaxDeliveryCount is the minimum value for max delivery count
MinMaxDeliveryCount = 0
// MaxMaxDeliveryCount is the maximum value for max delivery count
MaxMaxDeliveryCount = math.MaxInt32
Copy link
Contributor

Choose a reason for hiding this comment

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

we need a cap. Maybe look at all cgs on prod, and find out what's the max we're using today

@coveralls
Copy link

coveralls commented Jun 27, 2017

Coverage Status

Coverage decreased (-0.2%) to 68.402% when pulling 4387615 on validate_input into 9732c72 on master.

// MaxUnconsumedMessagesRetention is the maximum unconsumed retention
MaxUnconsumedMessagesRetention = 7 * 24 * 3600
// MinLockTimeoutSeconds is the minimum lock timeout seconds
MinLockTimeoutSeconds = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be at least 10 seconds

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. Let me update.

// MaxLockTimeoutSeconds is the maximum lock timeout seconds
MaxLockTimeoutSeconds = 3600
// MinMaxDeliveryCount is the minimum value for max delivery count
MinMaxDeliveryCount = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

min 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, just see the comment :)

@coveralls
Copy link

coveralls commented Jun 27, 2017

Coverage Status

Coverage decreased (-0.1%) to 68.472% when pulling 094e477 on validate_input into 9732c72 on master.

@hiboyang hiboyang merged commit 59bfb01 into master Jun 27, 2017
@hiboyang hiboyang deleted the validate_input branch June 27, 2017 22:33
datoug pushed a commit that referenced this pull request Jul 10, 2017
* Add input validation for cli tool

* Add admin_mode to bypass input validation for admin tool

* Update MinLockTimeoutSeconds and MinMaxDeliveryCount
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants