Skip to content

Commit

Permalink
Add log message in RestClient for ScatterGatherStrategy map URIs empt…
Browse files Browse the repository at this point in the history
…y case (#911)

Co-authored-by: Yingjie Bi <[email protected]>
  • Loading branch information
nickibi and Yingjie Bi authored Jun 2, 2023
1 parent 7cfe8bf commit 2f5e6b0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ and what APIs have changed, if applicable.

## [Unreleased]

## [29.42.4] - 2023-06-02
- Add log message in RestClient for ScatterGatherStrategy map URIs empty case

## [29.42.3] - 2023-05-18
- Support for UDS sockets for HTTP/1
- Make ValidationExtensionSchemaTask cacheable
Expand Down Expand Up @@ -5472,7 +5475,8 @@ patch operations can re-use these classes for generating patch messages.

## [0.14.1]

[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.42.3...master
[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.42.4...master
[29.42.4]: https://github.com/linkedin/rest.li/compare/v29.42.3...v29.42.4
[29.42.3]: https://github.com/linkedin/rest.li/compare/v29.42.2...v29.42.3
[29.42.2]: https://github.com/linkedin/rest.li/compare/v29.42.1...v29.42.2
[29.42.1]: https://github.com/linkedin/rest.li/compare/v29.42.0...v29.42.1
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=29.42.3
version=29.42.4
group=com.linkedin.pegasus
org.gradle.configureondemand=true
org.gradle.parallel=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import javax.activation.MimeTypeParseException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static com.linkedin.r2.disruptor.DisruptContext.*;

Expand Down Expand Up @@ -131,6 +133,7 @@
* @author Eran Leshem
*/
public class RestClient implements Client {
private static final Logger LOG = LoggerFactory.getLogger(RestClient.class);
private static final List<ContentType> DEFAULT_ACCEPT_TYPES = Collections.emptyList();
private static final ContentType DEFAULT_CONTENT_TYPE = ContentType.JSON;
private static final Random RANDOM_INSTANCE = new Random();
Expand Down Expand Up @@ -1108,6 +1111,9 @@ public void onSuccess(ProtocolVersion protocolVersion)
if (mappingResults == null || mappingResults.getMappedKeys().isEmpty())
{
// Strategy returns null URIMappingResult or empty mapped hosts, assuming no scatter is needed
LOG.error("ScatterGatherStrategy cannot map URIs for request: " + request
+ ", requestContext: " + requestContext
+ ", ScatterGatherStrategy needScatterGatherStrategy value: " + strategy.needScatterGather(request));
callback.onError(new RestLiScatterGatherException("ScatterGatherStrategy cannot map URIs, this should not happen!"));
return;
}
Expand Down

0 comments on commit 2f5e6b0

Please sign in to comment.