Skip to content

Commit 98a94fc

Browse files
authored
Add GraalVM Reachability Metadata and corresponding nativeTest for Firebird (#34307)
* Add GraalVM Reachability Metadata and corresponding nativeTest for Firebird * Fix the connection leak problem caused by improper configuration of unit test lifecycle
1 parent 7ef227a commit 98a94fc

File tree

40 files changed

+1683
-982
lines changed

40 files changed

+1683
-982
lines changed

RELEASE-NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
1. Metadata: Add support for partition tables in PostgreSQL [#34346](https://github.com/apache/shardingsphere/pull/34346)
1010
1. SQL Binder: Support select aggregation function sql bind in projection and having - [#34379](https://github.com/apache/shardingsphere/pull/34379)
11+
1. Proxy Native: Add GraalVM Reachability Metadata and corresponding nativeTest for Firebird - [#34307](https://github.com/apache/shardingsphere/pull/34307)
1112

1213
### Bug Fixes
1314

infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/proxy-config.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
"condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource"},
1212
"interfaces":["org.apache.hive.service.rpc.thrift.TCLIService$Iface"]
1313
},
14-
{
15-
"condition":{"typeReachable":"org.apache.shardingsphere.proxy.initializer.BootstrapInitializer"},
16-
"interfaces":["org.apache.seata.config.Configuration"]
17-
},
1814
{
1915
"condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"},
2016
"interfaces":["org.apache.seata.config.Configuration"]

infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reflect-config.json

Lines changed: 300 additions & 258 deletions
Large diffs are not rendered by default.

infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json

Lines changed: 392 additions & 407 deletions
Large diffs are not rendered by default.

infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/reflect-config.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,16 @@
357357
"name":"org.apache.shardingsphere.sql.parser.statement.sqlserver.ddl.SQLServerDropTableStatement",
358358
"methods":[{"name":"<init>","parameterTypes":[] }]
359359
},
360+
{
361+
"condition":{"typeReachable":"org.apache.shardingsphere.sql.parser.statement.firebird.dml.FirebirdDeleteStatement"},
362+
"name":"org.apache.shardingsphere.sql.parser.statement.firebird.dml.FirebirdDeleteStatement",
363+
"methods":[{"name":"<init>","parameterTypes":[] }]
364+
},
365+
{
366+
"condition":{"typeReachable":"org.apache.shardingsphere.sql.parser.statement.firebird.ddl.FirebirdDropTableStatement"},
367+
"name":"org.apache.shardingsphere.sql.parser.statement.firebird.ddl.FirebirdDropTableStatement",
368+
"methods":[{"name":"<init>","parameterTypes":[] }]
369+
},
360370
{
361371
"condition":{"typeReachable":"javax.security.auth.login.Configuration"},
362372
"name":"sun.security.provider.ConfigFile",

infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/resource-config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
"pattern":"\\QMETA-INF/services/javax.xml.parsers.SAXParserFactory\\E"
1515
}]},
1616
"bundles":[{
17+
"name":"com.sun.org.apache.xml.internal.serializer.XMLEntities",
18+
"locales":["en"]
19+
}, {
1720
"name":"com.microsoft.sqlserver.jdbc.SQLServerResource",
1821
"locales":["en"]
1922
}, {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
[
2+
{
3+
"condition":{"typeReachable":"org.firebirdsql.encodings.EncodingFactory"},
4+
"name":"org.firebirdsql.encodings.DefaultEncodingSet"
5+
},
6+
{
7+
"condition":{"typeReachable":"org.firebirdsql.gds.impl.GDSFactory"},
8+
"name":"org.firebirdsql.gds.impl.jni.EmbeddedGDSFactoryPlugin"
9+
},
10+
{
11+
"condition":{"typeReachable":"org.firebirdsql.gds.impl.GDSFactory"},
12+
"name":"org.firebirdsql.gds.impl.jni.NativeGDSFactoryPlugin"
13+
},
14+
{
15+
"condition":{"typeReachable":"org.firebirdsql.gds.impl.GDSFactory"},
16+
"name":"org.firebirdsql.gds.impl.oo.OOGDSFactoryPlugin"
17+
},
18+
{
19+
"condition":{"typeReachable":"org.firebirdsql.gds.impl.GDSFactory"},
20+
"name":"org.firebirdsql.gds.impl.wire.WireGDSFactoryPlugin"
21+
},
22+
{
23+
"condition":{"typeReachable":"org.firebirdsql.gds.ng.wire.auth.ClientAuthBlock"},
24+
"name":"org.firebirdsql.gds.ng.wire.auth.legacy.LegacyAuthenticationPluginSpi"
25+
},
26+
{
27+
"condition":{"typeReachable":"org.firebirdsql.gds.ng.wire.auth.ClientAuthBlock"},
28+
"name":"org.firebirdsql.gds.ng.wire.auth.srp.Srp224AuthenticationPluginSpi"
29+
},
30+
{
31+
"condition":{"typeReachable":"org.firebirdsql.gds.ng.wire.auth.ClientAuthBlock"},
32+
"name":"org.firebirdsql.gds.ng.wire.auth.srp.Srp256AuthenticationPluginSpi"
33+
},
34+
{
35+
"condition":{"typeReachable":"org.firebirdsql.gds.ng.wire.auth.ClientAuthBlock"},
36+
"name":"org.firebirdsql.gds.ng.wire.auth.srp.Srp384AuthenticationPluginSpi"
37+
},
38+
{
39+
"condition":{"typeReachable":"org.firebirdsql.gds.ng.wire.auth.ClientAuthBlock"},
40+
"name":"org.firebirdsql.gds.ng.wire.auth.srp.Srp512AuthenticationPluginSpi"
41+
},
42+
{
43+
"condition":{"typeReachable":"org.firebirdsql.gds.ng.wire.auth.ClientAuthBlock"},
44+
"name":"org.firebirdsql.gds.ng.wire.auth.srp.SrpAuthenticationPluginSpi"
45+
},
46+
{
47+
"condition":{"typeReachable":"org.firebirdsql.gds.ng.wire.version13.V13WireOperations"},
48+
"name":"org.firebirdsql.gds.ng.wire.crypt.arc4.Arc4EncryptionPluginSpi",
49+
"methods":[{"name":"<init>","parameterTypes":[] }]
50+
},
51+
{
52+
"condition":{"typeReachable":"org.firebirdsql.gds.ng.wire.version13.V13WireOperations"},
53+
"name":"org.firebirdsql.gds.ng.wire.crypt.chacha.ChaChaEncryptionPluginSpi"
54+
},
55+
{
56+
"condition":{"typeReachable":"org.firebirdsql.gds.ng.wire.ProtocolCollection"},
57+
"name":"org.firebirdsql.gds.ng.wire.version10.Version10Descriptor"
58+
},
59+
{
60+
"condition":{"typeReachable":"org.firebirdsql.gds.ng.wire.ProtocolCollection"},
61+
"name":"org.firebirdsql.gds.ng.wire.version11.Version11Descriptor"
62+
},
63+
{
64+
"condition":{"typeReachable":"org.firebirdsql.gds.ng.wire.ProtocolCollection"},
65+
"name":"org.firebirdsql.gds.ng.wire.version12.Version12Descriptor"
66+
},
67+
{
68+
"condition":{"typeReachable":"org.firebirdsql.gds.ng.wire.ProtocolCollection"},
69+
"name":"org.firebirdsql.gds.ng.wire.version13.Version13Descriptor"
70+
},
71+
{
72+
"condition":{"typeReachable":"org.firebirdsql.gds.ng.wire.ProtocolCollection"},
73+
"name":"org.firebirdsql.gds.ng.wire.version15.Version15Descriptor"
74+
},
75+
{
76+
"condition":{"typeReachable":"org.firebirdsql.gds.ng.wire.ProtocolCollection"},
77+
"name":"org.firebirdsql.gds.ng.wire.version16.Version16Descriptor"
78+
},
79+
{
80+
"condition":{"typeReachable":"org.firebirdsql.gds.ng.wire.ProtocolCollection"},
81+
"name":"org.firebirdsql.gds.ng.wire.version18.Version18Descriptor"
82+
},
83+
{
84+
"condition":{"typeReachable":"org.firebirdsql.jaybird.props.internal.UnregisteredDpbDefiner"},
85+
"name":"org.firebirdsql.jaybird.fb.constants.DpbItems",
86+
"allPublicFields":true
87+
},
88+
{
89+
"condition":{"typeReachable":"org.firebirdsql.jaybird.props.internal.UnregisteredDpbDefiner"},
90+
"name":"org.firebirdsql.jaybird.fb.constants.SpbItems",
91+
"allPublicFields":true
92+
},
93+
{
94+
"condition":{"typeReachable":"org.firebirdsql.jaybird.xca.FBManagedConnection"},
95+
"name":"org.firebirdsql.jaybird.xca.FBManagedConnection",
96+
"fields":[{"name":"connectionHandle"}, {"name":"unnotifiedWarnings"}]
97+
},
98+
{
99+
"condition":{"typeReachable":"org.firebirdsql.jaybird.xca.FBManagedConnectionFactory"},
100+
"name":"org.firebirdsql.jdbc.FBConnection",
101+
"methods":[{"name":"<init>","parameterTypes":["org.firebirdsql.jaybird.xca.FBManagedConnection"] }]
102+
},
103+
{
104+
"condition":{"typeReachable":"org.firebirdsql.jdbc.FBConnection"},
105+
"name":"org.firebirdsql.jdbc.FBConnection",
106+
"fields":[{"name":"savepointCounter"}]
107+
}
108+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"resources":{
3+
"includes":[{
4+
"condition":{"typeReachable":"org.firebirdsql.encodings.EncodingFactory"},
5+
"pattern":"\\QMETA-INF/services/org.firebirdsql.encodings.EncodingSet\\E"
6+
}, {
7+
"condition":{"typeReachable":"org.firebirdsql.gds.impl.GDSFactory"},
8+
"pattern":"\\QMETA-INF/services/org.firebirdsql.gds.impl.GDSFactoryPlugin\\E"
9+
}, {
10+
"condition":{"typeReachable":"org.firebirdsql.gds.ng.wire.ProtocolCollection"},
11+
"pattern":"\\QMETA-INF/services/org.firebirdsql.gds.ng.wire.ProtocolDescriptor\\E"
12+
}, {
13+
"condition":{"typeReachable":"org.firebirdsql.gds.ng.wire.auth.ClientAuthBlock"},
14+
"pattern":"\\QMETA-INF/services/org.firebirdsql.gds.ng.wire.auth.AuthenticationPluginSpi\\E"
15+
}, {
16+
"condition":{"typeReachable":"org.firebirdsql.jaybird.props.internal.ConnectionPropertyRegistry"},
17+
"pattern":"\\QMETA-INF/services/org.firebirdsql.jaybird.props.spi.ConnectionPropertyDefinerSpi\\E"
18+
}, {
19+
"condition":{"typeReachable":"org.firebirdsql.gds.MessageLoader"},
20+
"pattern":"\\Qisc_error_msg.properties\\E"
21+
}, {
22+
"condition":{"typeReachable":"org.firebirdsql.gds.MessageLoader"},
23+
"pattern":"\\Qisc_error_sqlstates.properties\\E"
24+
}, {
25+
"condition":{"typeReachable":"org.firebirdsql.jaybird.Version"},
26+
"pattern":"\\Qorg/firebirdsql/jaybird/version.properties\\E"
27+
}, {
28+
"condition":{"typeReachable":"org.firebirdsql.jaybird.Version"},
29+
"pattern":"\\Qorg/firebirdsql/jaybird/version_zh.properties\\E"
30+
}, {
31+
"condition":{"typeReachable":"org.firebirdsql.jaybird.Version"},
32+
"pattern":"\\Qorg/firebirdsql/jaybird/version_zh_CN.properties\\E"
33+
}, {
34+
"condition":{"typeReachable":"org.firebirdsql.jaybird.Version"},
35+
"pattern":"\\Qorg/firebirdsql/jaybird/version_zh_Hans.properties\\E"
36+
}, {
37+
"condition":{"typeReachable":"org.firebirdsql.jaybird.Version"},
38+
"pattern":"\\Qorg/firebirdsql/jaybird/version_zh_Hans_CN.properties\\E"
39+
}, {
40+
"condition":{"typeReachable":"org.firebirdsql.gds.MessageLoader"},
41+
"pattern":"\\Qorg/firebirdsql/jaybird_error_msg.properties\\E"
42+
}, {
43+
"condition":{"typeReachable":"org.firebirdsql.gds.MessageLoader"},
44+
"pattern":"\\Qorg/firebirdsql/jaybird_error_sqlstates.properties\\E"
45+
}]},
46+
"bundles":[{
47+
"name":"org.firebirdsql.jaybird.version",
48+
"locales":["zh-CN", "en"]
49+
}]
50+
}

kernel/transaction/type/base/seata-at/src/main/java/org/apache/shardingsphere/transaction/base/seata/at/SeataATShardingSphereTransactionManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ public boolean containsProviderType(final String providerType) {
155155
public void close() {
156156
dataSourceMap.clear();
157157
SeataTransactionHolder.clear();
158-
RmNettyRemotingClient.getInstance().destroy();
159158
TmNettyRemotingClient.getInstance().destroy();
159+
RmNettyRemotingClient.getInstance().destroy();
160160
ConfigurationFactory.reload();
161161
}
162162

test/native/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@
202202
</exclusion>
203203
</exclusions>
204204
</dependency>
205+
<dependency>
206+
<groupId>org.firebirdsql.jdbc</groupId>
207+
<artifactId>jaybird</artifactId>
208+
<scope>test</scope>
209+
</dependency>
205210
<dependency>
206211
<groupId>org.testcontainers</groupId>
207212
<artifactId>junit-jupiter</artifactId>

0 commit comments

Comments
 (0)