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

Fix bug that overwrites query options for blocking timeout #1

Merged
merged 1 commit into from
Oct 9, 2014

Conversation

gburton1
Copy link

@gburton1 gburton1 commented Oct 9, 2014

When we call into the health client from consul-service-discovery, we set the query options:

healthClient.getHealthyNodesAsync(serviceName, builder().blockMinutes(TIMEOUT_IN_MINS, startIndex).build(), consulDiscoveryCallback);

When we provide a timeout value like this, the builder marks the "blocking" flag as true in the query options. But then we are guaranteed to overwrite the timeout values that we set because of the logic below (isBlocking() is true if "wait" has been set to any value)

public static void response(WebTarget target, CatalogOptions catalogOptions,
QueryOptions queryOptions,
GenericType type,
ConsulResponseCallback callback) {
if(queryOptions.isBlocking()) {
queryOptions = QueryOptionsBuilder.builder().queryOptions(queryOptions)
.blockMinutes(5, queryOptions.getIndex()).build();
}

I think we can simply remove this block. If it is blocking, then someone has already set the timeout in the query options.

rickfast added a commit that referenced this pull request Oct 9, 2014
Fix bug that overwrites query options for blocking timeout
@rickfast rickfast merged commit d8f2639 into rickfast:master Oct 9, 2014
rickfast pushed a commit that referenced this pull request Dec 24, 2014
Fix XML node closing in README
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.

None yet

2 participants