-
Notifications
You must be signed in to change notification settings - Fork 785
various repository methods should use interactive timeout #2108
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
Conversation
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.
Just wondering about interactive
in a few places. Otherwise LGTM.
} | ||
|
||
@Override | ||
protected void buildTagList(File directory) { | ||
protected void buildTagList(File directory, boolean interactive) { |
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.
Wondering whether the new interactive
parameter should possibly be used in this method.
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.
good catch, yes. Also, I've just hit this when testing full reindex on a busy machine where I deliberately set the interactive timeout to 3 seconds.
@@ -295,57 +263,23 @@ boolean hasFileBasedTags() { | |||
* @param directory Directory where we list tags | |||
*/ | |||
@Override | |||
protected void buildTagList(File directory) { | |||
protected void buildTagList(File directory, boolean interactive) { |
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.
Wondering if new interactive
should be used in this method.
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.
ditto
@@ -613,70 +561,23 @@ boolean hasFileBasedTags() { | |||
} | |||
|
|||
@Override | |||
protected void buildTagList(File directory) { | |||
protected void buildTagList(File directory, boolean interactive) { |
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.
Should new interactive
be used in the method?
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.
ditto
In the end I decided to properly propagate the interactive flag from |
As for the In other words, the definition would be: whatever comes from UI/webapp is considered interactive. |
0eddb36
to
9262904
Compare
9262904
to
49de4b0
Compare
This change introduces interactive timeout that will be used when:
Message
or whenSearch
is done using CLI)The first item basically triggers
invalidateRepositories()
inHistoryGuru
that will in turn callgetRepositories()
. Thus, all theRepository
calls inside need to be made "interactive".Basically, I've modified all repositories to use
Executor
as opposed toRuntime
orProcessBuilder
directly. I don't like the way howExecutor
sets up the timeout too much (it should not know aboutRuntimeEnvironment
or unsetthis.timeout
when it is already set. Maybe it should also have getter/setter for timeout.), however that's for next time.Also, maybe all the repository annotation/tag parsers should be an interface/abstract class however there are subtle difference how these are implemented for various repositories so for the time being I mirrored the style already used by Bitkeeper repository.
After the change there will be 3 types of timeout related behavior:
Tested with unreachable Subversion repository + webapp start and also full reindex.