[FlightSQL] Statement.execute(String) can leak server prepared-statement handles when reused
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
從 Flight SQL 的 JDBC 實作中的 Statement.execute(String) 開始,追蹤 prepared-statement handles 如何被取代及關閉;該 issue 沒有指定檔案或測試。針對具狀態的 Flight SQL 伺服器重現此迴圈,然後確認每個先前的 handle 都會在下一個 handle 被追蹤之前釋放,且 Statement.close 仍會清理最後的 handle。
由索引模型根據 Issue 內容生成。
描述
Describe the bug, including details regarding any error messages, version, and platform.
When reusing the same JDBC Statement and calling execute(String) multiple times, the Flight SQL JDBC path creates a new prepared statement on each call, but previous prepared handles are not closed before being replaced in client tracking state.
This means only the latest handle is guaranteed to be closed when the statement is closed. On stateful Flight SQL servers, this can leak server-side resources associated with older handles.
Repro
try (Connection connection = DriverManager.getConnection(jdbcUrl, properties);
Statement statement = connection.createStatement()) {
for (int i = 1; i <= n; i++) {
String sql = "SELECT " + i;
boolean isResultSet = statement.execute(sql);
if (isResultSet) {
try (ResultSet rs = statement.getResultSet()) {
while (rs.next()) { /* consume */ }
}
}
}
}
Raised in https://github.com/apache/arrow-java/pull/1090#discussion_r3132344585
- 主要語言
- Java
- 星號
- 97
- 分支
- 158
- 平均合併
- 7 天 12 小時
- 30 天內合併 PR
- 31
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
apache/arrow-java 的其他 Issue
-
DictionaryEncoder.decode accepts out-of-range dictionary indices可能已有人在做 @Arawoof06 於 48 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 74/100
apache/arrow-java#1261 ·
維護者通常 1 天內回覆
-
ArrowFlightJdbcArray.getArray(index, count) can read past the end of the array slice可能已有人在做 @Arawoof06 於 78 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
apache/arrow-java#1236 ·
維護者通常 1 天內回覆
-
[Java][JDBC] ClobConsumer writes past VarCharVector data buffer for large CLOBs可能已有人在做 @Arawoof06 於 83 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
apache/arrow-java#1230 ·
維護者通常 1 天內回覆
-
Byte-array elements leak in `FromSchemaByteArray()`可能已有人在做 @PG1204 於 73 天前認領。 未關閉Type: bug
難度 2/5 1-3 小時 新手友好度 85/100
apache/arrow-java#1205 ·
維護者通常 1 天內回覆
-
[Java][IPC] AbstractCompressionCodec.compress() writes prefix=0 for empty buffers, incompatible with C++/Python readers可能已有人在做 @PG1204 於 73 天前認領。 未關閉Type: bug
難度 2/5 1-3 小時 新手友好度 68/100
apache/arrow-java#1196 · 1 則留言 ·
維護者通常 1 天內回覆
查看 apache/arrow-java 的全部 Issue
相似的 Issue
-
[destination-snowflake] Custom domains rejected unlike source connections可能已有人在做 @kuza55 今天認領。 未關閉autoteam community connectors/destination/snowflake team/use
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
area-dashboard
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
component/operate kind/feature-request
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 1 天內回覆
-
Forge coverage prompts carry text the agent cannot act on可能已有人在做 @graalvmbot 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 85/100
oracle/graalvm-reachability-metadata#10572 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
IBM/sample-app-mod#55 ·