Crossed references lead to a io.vertx.core.VertxException: Thread blocked
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- java
调研方向
从 JsonRef.parse、JsonRef.resolve 和 JsonRef.resolveUri 开始,然后检查堆栈跟踪中的 Utils$Pointers.escape 和 SchemaRepositoryImpl.resolve。复现 issue 中描述的交叉 A.yaml 引用,并验证 contract 加载能够完成,且递归解析不会阻塞工作线程。
由索引模型根据 Issue 内容生成。
描述
Questions
Do not use this issue tracker to ask questions, instead use one of these channels. Questions will likely be closed without notice.
Version
4.5.8
Context
As described in #74 we work with more than one hundred of OpenAPI files. Most of them use relative references to components in other OpenAPI files. They are provided by a third party.
With the aim of going further, we have updated the relative references by fake absolute references in a given OpenAPI file (A).
It lead us to update some other OpenAPI files and one of them contained a reference to the first one OpenAPI file A.
The OpenAPIContract.from call looks like that (A is in the same time as unresolvedContractPath and in additionalContractFiles):
OpenAPIContract.from(
vertx
, "A.yaml"
, Map.of(
"https://www.example.com/B.yaml", "B.yaml"
, "https://www.example.com/C.yaml", "C.yaml"
, "https://www.example.com/D.yaml", "D.yaml"
, "https://www.example.com/A.yaml", "A.yaml"
)
).onSuccess(contract -> {
contract.operations().forEach(op -> LOGGER.info("operationId=", op.getOperationId()));
LOGGER.info("end of onSuccess");
}).onFailure(t -> LOGGER.error("onFailure t=", t));
When running the app, the following option is thrown:
2024-06-10 16:26:42,116 WARN [vertx-blocked-thread-checker] ?: Thread Thread[vert.x-worker-thread-3,5,io.vertx.core.Launcher] has been blocked for 60885 ms, time limit is 60000 ms
io.vertx.core.VertxException: Thread blocked
at [email protected]/java.util.regex.Pattern$Start.match(Pattern.java:3608)
at [email protected]/java.util.regex.Matcher.search(Matcher.java:1728)
at [email protected]/java.util.regex.Matcher.find(Matcher.java:745)
at [email protected]/java.util.regex.Matcher.replaceAll(Matcher.java:1177)
at [email protected]/java.lang.String.replaceAll(String.java:2942)
at io.vertx.json.schema.impl.Utils$Pointers.escape(Utils.java:303)
at io.vertx.json.schema.impl.JsonRef.parse(JsonRef.java:275)
at io.vertx.json.schema.impl.JsonRef.parse(JsonRef.java:275)
at io.vertx.json.schema.impl.JsonRef.parse(JsonRef.java:275)
at io.vertx.json.schema.impl.JsonRef.parse(JsonRef.java:275)
at io.vertx.json.schema.impl.JsonRef.parse(JsonRef.java:275)
at io.vertx.json.schema.impl.JsonRef.parse(JsonRef.java:275)
at io.vertx.json.schema.impl.JsonRef.resolve(JsonRef.java:133)
at io.vertx.json.schema.impl.JsonRef.resolveUri(JsonRef.java:341)
at io.vertx.json.schema.impl.JsonRef.resolve(JsonRef.java:211)
at io.vertx.json.schema.impl.JsonRef.resolveUri(JsonRef.java:341)
at io.vertx.json.schema.impl.JsonRef.resolve(JsonRef.java:211)
at io.vertx.json.schema.impl.JsonRef.resolveUri(JsonRef.java:341)
at io.vertx.json.schema.impl.JsonRef.resolve(JsonRef.java:211)
...
...
...
at io.vertx.json.schema.impl.JsonRef.resolveUri(JsonRef.java:341)
at io.vertx.json.schema.impl.JsonRef.resolve(JsonRef.java:211)
at io.vertx.json.schema.impl.JsonRef.resolveUri(JsonRef.java:341)
at io.vertx.json.schema.impl.JsonRef.resolve(JsonRef.java:211)
at io.vertx.json.schema.impl.JsonRef.resolveUri(JsonRef.java:341)
at io.vertx.json.schema.impl.JsonRef.resolve(JsonRef.java:211)
at io.vertx.json.schema.impl.SchemaRepositoryImpl.resolve(SchemaRepositoryImpl.java:243)
at io.vertx.openapi.contract.OpenAPIVersion.lambda$resolve$3(OpenAPIVersion.java:86)
at io.vertx.openapi.contract.OpenAPIVersion$$Lambda$499/0x00000008010f9708.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:191)
at io.vertx.core.impl.ContextImpl$$Lambda$471/0x000000080109fd08.handle(Unknown Source)
at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:279)
at io.vertx.core.impl.ContextImpl.lambda$internalExecuteBlocking$2(ContextImpl.java:210)
at io.vertx.core.impl.ContextImpl$$Lambda$472/0x00000008010a41f8.run(Unknown Source)
at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
at io.vertx.core.impl.TaskQueue$$Lambda$455/0x0000000801092a80.run(Unknown Source)
at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at [email protected]/java.lang.Thread.run(Thread.java:833)
Do you have a reproducer?
A reproducer is a simple project hosted on GitHub (or another forge supporting git clone operation) that has a build file that can be executed to reproduce the issue.
Reproducers are very helpful for contributors and will likely help them fixing your bug faster.
- Link to github project/gist
Steps to reproduce
- ...
- ...
- ...
- ...
Extra
- Anything that can be relevant such as OS version, JVM version
- 主要语言
- Java
- 星标
- 15
- 派生
- 19
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
eclipse-vertx/vertx-openapi 的其他 Issue
-
bug
难度 3/5 1-2 天 新手友好度 55/100
eclipse-vertx/vertx-openapi#137 · 5 条评论 ·
-
enhancement help wanted
难度 4/5 3-5 天 新手友好度 45/100
eclipse-vertx/vertx-openapi#136 · 1 条评论 ·
-
enhancement
难度 3/5 1-2 天 新手友好度 38/100
eclipse-vertx/vertx-openapi#122 · 4 条评论 ·
-
bug
难度 2/5 1-3 小时 新手友好度 48/100
eclipse-vertx/vertx-openapi#117 · 6 条评论 ·
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
eclipse-vertx/vertx-openapi#93 · 1 条评论 ·
查看 eclipse-vertx/vertx-openapi 的全部 Issue
相似的 Issue
-
bug web-server
难度 2/5 1-3 小时 新手友好度 78/100
jooby-project/jooby#4035 ·
维护者通常 1 天内回复
-
L: javascript
难度 2/5 1-3 小时 新手友好度 72/100
dependabot/dependabot-core#16744 ·
维护者通常 1 天内回复
-
intake mcp-intake needs-human-review priority:high type:bug
难度 2/5 1-3 小时 新手友好度 62/100
Ikalus1988/MisakaNet#3987 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
quarkiverse/quarkus-google-cloud-services#1187 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
locationtech/jts#1250 ·