-
Notifications
You must be signed in to change notification settings - Fork 142
[#6350] allow a purge of monitoring rows in rsGeneralRowPurge (4-2-stable) #7018
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
base: 4-2-stable
Are you sure you want to change the base?
Conversation
So that the test does not need an entire hour to complete.
server/re/src/reIn2p3SysRule.cpp
Outdated
| if ( atoi( timespan ) > 0 ) { | ||
| elapseTime = atoi( timespan ) * 3600; | ||
| char *endc{}; | ||
| if (int scanned_number = strtol( timespan, &endc, 10 ); nullptr != endc && *endc == 's') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to change the behavior of the MSI.
The docs state the time is in hours. It doesn't mention seconds being supported. What motivated this change?
What happens if the user passes "250 s"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The basic motivation is to allow a test that doesn't take hours. As it is, the row purge takes "default" or a quoted integer, and "default" or "0" results in keeping any rows less old than the default window of 24hr , which is too long a runtime for a test. Best case we'd use "1", which would make the window 1 hour ... or ... optionally allow seconds as units, which was the path I chose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood. I think we may need to move this to 4.3 only.
This PR is introducing an enhancement which doesn't feel mandatory for 4.2.12. It may also introduce more bugs due to edge cases with the seconds suffix.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the unit is optional and the behavior does not change for existing usage, I feel like it is okay. Do you have a specific concern in mind?
One positive effect is that this MSI is now being tested, which was not the case before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood. I think we may need to move this to 4.3 only.
@korydraughn I'm easy... it doesn't seem that critical to me that the purge msi work properly on 4.2.x, as those who run it are probably already well familiar with the problem and - I'm sure - run a cron job to do the same thing.
@alanking - testing and documention will both be nice-to-haves. Which actually brings me to this: the only reason this test of msiServerMonPerf is not currently failing in our container based core test-suite is that we're not using -r irods_rule_engine_plugin-irods_rule_language-instance in the irule invocation. :O
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ways of holding it wrong are, as far as I can think of and haven't allowed for yet:
- too small or large an integer, that is negative or greater than
numeric_limits<int>::max() - use of some bizarre form of whitespace (
"\f","\r", etc) - units other than (s)econds, ie. assuming we offer (m)inutes as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can detect invalid input and reject it, then I think we will be in a good spot to ship this in 4.2.12.
Try and make it very strict about what it will accept. That way, no one can hold it wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can patch up the holes, no problem. Do we expect we'll want to allow all time units (s,m,h,d,y) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not for 4.2.12 unless it's trivial to implement correctly.
Years seems excessive and days can be defined in terms of hours.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, ok thanks.
|
|
||
| namespace { | ||
|
|
||
| auto seconds_from_integer_time_and_units(const char *numstring) -> std::tuple<int,std::string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getOffsetTimeStr seems to be basically the same parser as the one written here, but the default unit is seconds instead of hours. This is used by the delay server to figure out when to execute things, so it has had more exposure to the elements as far as error handling and testing.
Perhaps we could hook into this, somehow, and avoid having 2 of these?
|
#6350 has been bumped to 4.3.2 milestone, so this will be closed without merging. Leaving it open for now. |
No description provided.