-
Notifications
You must be signed in to change notification settings - Fork 313
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
Be resilient upon startup #730
Be resilient upon startup #730
Conversation
With this commit we make Rally more resilient when it is not able to determine some information upon startup of the cluster.
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.
LGTM. Left a question and styling comments.
# noinspection PyBroadException | ||
try: | ||
distribution_version = es.info()["version"]["number"] | ||
except BaseException: |
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.
Do we need such a broad exception here? I thought (ReadTimeoutError
, ConnectionTimeout
, AuthorizationException
, ConnectionError
) is sufficient?
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.
We don't but I wanted to avoid importing the elasticsearch module just for that.
|
||
def wrap(it): |
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.
PEP8: 2 blank lines here
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.
Addressed in 3cfa545. Not sure why my IDE didn't show it earlier...
def wrap(it): | ||
return it if callable(it) else ResponseSupplier(it) | ||
|
||
class ResponseSupplier: |
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.
PEP8: 2 blank lines here
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.
Addressed in 3cfa545.
def __call__(self, *args, **kwargs): | ||
raise elasticsearch.TransportError | ||
|
||
raiseTransportError = TransportErrorSupplier() |
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.
PEP8: 2 blank lines here
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.
Addressed in 3cfa545.
def __call__(self, *args, **kwargs): | ||
raise elasticsearch.TransportError | ||
|
||
raiseTransportError = TransportErrorSupplier() | ||
|
||
class TransportClient: |
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.
PEP8: 2 blank lines here
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.
Addressed in 3cfa545.
@dliappis thanks for the initial pass. I've addressed your comments. Can you please have another look? |
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.
LGTM
With this commit we make Rally more resilient when it is not able to determine some information upon startup of the cluster. Relates elastic#730
With this commit we make Rally more resilient when it is not able to determine some information upon startup of the cluster. Relates elastic#730
With this commit we make Rally more resilient when it is not able to determine some information upon startup of the cluster. Relates elastic#730
With this commit we make Rally more resilient when it is not able to
determine some information upon startup of the cluster.