Skip to content

Commit 18c802c

Browse files
authored
Remove string limitation in Jackson deserializer for ES Client (#13283)
1 parent 04648b3 commit 18c802c

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

docs/en/changes/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* Bump up commons-beanutils to 1.11.0.
2828
* Refactor: simplify the `Accept` http header process.
2929
* [Break Change]Storage: Move `event` from metrics to recods.
30+
* Remove string limitation in Jackson deserializer for ElasticSearch client.
3031

3132
#### UI
3233

oap-server/server-library/library-elasticsearch-client/src/main/java/org/apache/skywalking/library/elasticsearch/ElasticSearch.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
package org.apache.skywalking.library.elasticsearch;
1919

2020
import com.fasterxml.jackson.annotation.JsonInclude;
21+
import com.fasterxml.jackson.core.JsonFactoryBuilder;
22+
import com.fasterxml.jackson.core.StreamReadConstraints;
2123
import com.fasterxml.jackson.databind.DeserializationFeature;
2224
import com.fasterxml.jackson.databind.ObjectMapper;
2325
import com.linecorp.armeria.client.ClientFactory;
@@ -60,7 +62,10 @@
6062
@Slf4j
6163
@Accessors(fluent = true)
6264
public final class ElasticSearch implements Closeable {
63-
private final ObjectMapper mapper = new ObjectMapper()
65+
private final ObjectMapper mapper = new ObjectMapper(
66+
new JsonFactoryBuilder()
67+
.streamReadConstraints(StreamReadConstraints.builder().maxStringLength(Integer.MAX_VALUE).build())
68+
.build())
6469
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
6570
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
6671

test/e2e-v2/cases/lua/Dockerfile.nginx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ RUN tar -xf ${SW_AGENT_NGINX_LUA_COMMIT}.tar.gz --strip 1
2525

2626
RUN rm ${SW_AGENT_NGINX_LUA_COMMIT}.tar.gz
2727

28-
RUN luarocks make rockspec/skywalking-nginx-lua-master-0.rockspec
28+
RUN luarocks make --only-server https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/daab2726276e3282dc347b89a42a5107c3500567 rockspec/skywalking-nginx-lua-master-0.rockspec
2929

test/e2e-v2/cases/nginx/Dockerfile.nginx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515

1616
FROM openresty/openresty:1.17.8.2-5-alpine-fat
1717

18-
RUN luarocks install nginx-lua-prometheus
19-
RUN mkdir -p /var/log/nginx/
18+
RUN luarocks --only-server https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/daab2726276e3282dc347b89a42a5107c3500567 install nginx-lua-prometheus
19+
RUN mkdir -p /var/log/nginx/

0 commit comments

Comments
 (0)