fix(syslog-serve): 扩大微步5万条日志响应容量
- 按50000条、每条最大10KiB将响应上限调整为512MiB - 将微步适配器最大响应字节数提高至536870912 - 将JSON解析token上限由200万提高至2500万 - 同步放宽管理接口和达梦数据库响应大小约束 - 更新微步任务模板、v6升级脚本和现场部署文档 - 增加50000条及512MiB配置边界测试 - 更新启动版本标识为WEIBU_5S_50000_512M_V20260917_71 验证: - JDK 8测试通过:167个,失败0,错误0,跳过2 - Maven BUILD SUCCESS - git diff --check通过
This commit is contained in:
+1
-1
@@ -12,7 +12,7 @@ import org.springframework.stereotype.Component;
|
||||
public class SyslogBuildStartupLogger {
|
||||
|
||||
// 确认 JAR 包含设备级采集模式、API 拉取、探针归属过滤、微步全量查询及诊断接口。
|
||||
static final String CODE_REVISION = "WEIBU_5S_50000_SCAN1S_V20260917_70";
|
||||
static final String CODE_REVISION = "WEIBU_5S_50000_512M_V20260917_71";
|
||||
private final Environment environment;
|
||||
|
||||
public SyslogBuildStartupLogger(Environment environment) {
|
||||
|
||||
+4
-2
@@ -81,6 +81,8 @@ public class WeibuApiAdapter implements ApiPullAdapter {
|
||||
UUID.fromString("89a53d59-bb84-5d41-924f-38319448cf46");
|
||||
private static final long MIN_EVENT_EPOCH_SECOND = 946684800L;
|
||||
private static final long MAX_EVENT_EPOCH_SECOND = 4102444800L;
|
||||
private static final long MAX_RESPONSE_BYTES = 536870912L;
|
||||
private static final int MAX_JSON_TOKENS = 25000000;
|
||||
|
||||
private final CredentialProvider credentials;
|
||||
private final SafeBaseUrlValidator urls;
|
||||
@@ -176,7 +178,7 @@ public class WeibuApiAdapter implements ApiPullAdapter {
|
||||
range(c.getRequestTimeoutMs(), 1000, 120000);
|
||||
if (c.getMaxResponseBytes() == null
|
||||
|| c.getMaxResponseBytes() < 1024
|
||||
|| c.getMaxResponseBytes() > 67108864L) fail("CONFIG_SCHEMA_ERROR");
|
||||
|| c.getMaxResponseBytes() > MAX_RESPONSE_BYTES) fail("CONFIG_SCHEMA_ERROR");
|
||||
URI base = urls.validate(c.getBaseUrl());
|
||||
String path = base.getPath();
|
||||
if (!(path == null || path.isEmpty() || "/".equals(path))) fail("CONFIG_SCHEMA_ERROR");
|
||||
@@ -541,7 +543,7 @@ public class WeibuApiAdapter implements ApiPullAdapter {
|
||||
int tokens = 0;
|
||||
JsonToken token;
|
||||
while ((token = parser.nextToken()) != null) {
|
||||
if (++tokens > 2000000) fail("RESPONSE_SCHEMA_ERROR");
|
||||
if (++tokens > MAX_JSON_TOKENS) fail("RESPONSE_SCHEMA_ERROR");
|
||||
if (token == JsonToken.START_OBJECT || token == JsonToken.START_ARRAY) {
|
||||
if (++depth > 64) fail("RESPONSE_SCHEMA_ERROR");
|
||||
} else if (token == JsonToken.END_OBJECT || token == JsonToken.END_ARRAY) {
|
||||
|
||||
+2
-2
@@ -83,7 +83,7 @@ public final class ApiPullDtos {
|
||||
private Integer lookbackSeconds = 0;
|
||||
|
||||
@Min(1024)
|
||||
@Max(268435456)
|
||||
@Max(536870912)
|
||||
private Long maxResponseBytes = 16777216L;
|
||||
|
||||
@NotNull private OffsetDateTime initialStartTime;
|
||||
@@ -145,7 +145,7 @@ public final class ApiPullDtos {
|
||||
private Integer lookbackSeconds;
|
||||
|
||||
@Min(1024)
|
||||
@Max(268435456)
|
||||
@Max(536870912)
|
||||
private Long maxResponseBytes;
|
||||
|
||||
@NotNull private Map<String, Object> extraConfig;
|
||||
|
||||
+10
-3
@@ -45,9 +45,16 @@ class ApiPullContractTest {
|
||||
|
||||
@Test
|
||||
void managementDtoAllowsWeibuFiftyThousandRecordWindow() throws Exception {
|
||||
Max max = CreateApiPullTaskRequest.class.getDeclaredField("pageSize").getAnnotation(Max.class);
|
||||
assertNotNull(max);
|
||||
assertEquals(50000L, max.value());
|
||||
Max pageMax =
|
||||
CreateApiPullTaskRequest.class.getDeclaredField("pageSize").getAnnotation(Max.class);
|
||||
assertNotNull(pageMax);
|
||||
assertEquals(50000L, pageMax.value());
|
||||
Max responseMax =
|
||||
CreateApiPullTaskRequest.class
|
||||
.getDeclaredField("maxResponseBytes")
|
||||
.getAnnotation(Max.class);
|
||||
assertNotNull(responseMax);
|
||||
assertEquals(536870912L, responseMax.value());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+12
@@ -261,6 +261,18 @@ class WeibuApiAdapterTest {
|
||||
.getCode());
|
||||
verifyNoInteractions(capacity.http);
|
||||
|
||||
Fixture responseCapacity = new Fixture();
|
||||
responseCapacity.config.setMaxResponseBytes(536870912L);
|
||||
responseCapacity.adapter.validateConfig(responseCapacity.config);
|
||||
responseCapacity.config.setMaxResponseBytes(536870913L);
|
||||
assertEquals(
|
||||
"CONFIG_SCHEMA_ERROR",
|
||||
assertThrows(
|
||||
AdapterException.class,
|
||||
() -> responseCapacity.adapter.validateConfig(responseCapacity.config))
|
||||
.getCode());
|
||||
verifyNoInteractions(responseCapacity.http);
|
||||
|
||||
Fixture incident = new Fixture();
|
||||
incident.config.setStreamKey("WEIBU_INCIDENT");
|
||||
assertEquals(
|
||||
|
||||
Reference in New Issue
Block a user