Skip to content

Commit bbbbec7

Browse files
authored
optimize: remove fst serialization (apache#6002)
1 parent 1de3532 commit bbbbec7

File tree

23 files changed

+17
-483
lines changed

23 files changed

+17
-483
lines changed

all/pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,6 @@
254254
<artifactId>seata-serializer-kryo</artifactId>
255255
<version>${project.version}</version>
256256
</dependency>
257-
<dependency>
258-
<groupId>io.seata</groupId>
259-
<artifactId>seata-serializer-fst</artifactId>
260-
<version>${project.version}</version>
261-
</dependency>
262257
<dependency>
263258
<groupId>io.seata</groupId>
264259
<artifactId>seata-serializer-hessian</artifactId>
@@ -586,11 +581,6 @@
586581
<artifactId>kryo</artifactId>
587582
<scope>provided</scope>
588583
</dependency>
589-
<dependency>
590-
<groupId>de.ruedigermoeller</groupId>
591-
<artifactId>fst</artifactId>
592-
<scope>provided</scope>
593-
</dependency>
594584
<dependency>
595585
<groupId>com.dameng</groupId>
596586
<artifactId>DmJdbcDriver18</artifactId>

bom/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,6 @@
270270
<artifactId>seata-serializer-hessian</artifactId>
271271
<version>${project.version}</version>
272272
</dependency>
273-
<dependency>
274-
<groupId>io.seata</groupId>
275-
<artifactId>seata-serializer-fst</artifactId>
276-
<version>${project.version}</version>
277-
</dependency>
278273
<dependency>
279274
<groupId>io.seata</groupId>
280275
<artifactId>seata-spring-boot-starter</artifactId>

changes/en-us/2.0.0.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ The version is updated as follows:
149149
- [[#5938](https://github.com/seata/seata/pull/5938)] support jmx port in seata
150150
- [[#5951](https://github.com/seata/seata/pull/5951)] remove un support config in jdk17
151151
- [[#5959](https://github.com/seata/seata/pull/5959)] modify code style and remove unused import
152+
- [[#6002](https://github.com/seata/seata/pull/6002)] remove fst serialization
153+
152154

153155
### security:
154156
- [[#5642](https://github.com/seata/seata/pull/5642)] add Hessian Serializer WhiteDenyList

changes/zh-cn/2.0.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
150150
- [[#5938](https://github.com/seata/seata/pull/5938)] 支持 jmx 监控配置
151151
- [[#5951](https://github.com/seata/seata/pull/5951)] 删除在 jdk17 中不支持的配置项
152152
- [[#5959](https://github.com/seata/seata/pull/5959)] 修正代码风格问题及去除无用的类引用
153+
- [[#6002](https://github.com/seata/seata/pull/6002)] 移除fst序列化模块
153154

154155

155156
### security:

core/src/main/java/io/seata/core/serializer/SerializerType.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public enum SerializerType {
4444
KRYO((byte)0x4),
4545

4646
/**
47-
* The fst.
47+
* The fst but it's been removed.
4848
* <p>
4949
* Math.pow(2, 3)
5050
*/
@@ -56,8 +56,9 @@ public enum SerializerType {
5656
* Math.pow(2, 4)
5757
*/
5858
HESSIAN((byte)0x16),
59+
5960
/**
60-
* The hessian.
61+
* The jackson.
6162
* <p>
6263
* Math.pow(2, 5)
6364
*/
@@ -82,6 +83,10 @@ public static SerializerType getByCode(int code) {
8283
return b;
8384
}
8485
}
86+
if (code == SerializerType.FST.getCode()) {
87+
throw new IllegalArgumentException(
88+
"Since fst is no longer maintained, this serialization extension has been removed from version 2.0 for security and stability reasons.");
89+
}
8590
throw new IllegalArgumentException("unknown codec:" + code);
8691
}
8792

dependencies/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
<kryo.version>5.4.0</kryo.version>
7979
<kryo-serializers.version>0.45</kryo-serializers.version>
8080
<hessian.version>4.0.63</hessian.version>
81-
<fst.version>2.57</fst.version>
8281
<groovy.version>2.4.4</groovy.version>
8382
<zstd.version>1.5.0-4</zstd.version>
8483
<xstream.version>1.4.20</xstream.version>
@@ -561,11 +560,6 @@
561560
<artifactId>hessian</artifactId>
562561
<version>${hessian.version}</version>
563562
</dependency>
564-
<dependency>
565-
<groupId>de.ruedigermoeller</groupId>
566-
<artifactId>fst</artifactId>
567-
<version>${fst.version}</version>
568-
</dependency>
569563
<dependency>
570564
<groupId>org.apache.commons</groupId>
571565
<artifactId>commons-compress</artifactId>

rm-datasource/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,6 @@
103103
<scope>provided</scope>
104104
<optional>true</optional>
105105
</dependency>
106-
<dependency>
107-
<groupId>de.ruedigermoeller</groupId>
108-
<artifactId>fst</artifactId>
109-
<scope>provided</scope>
110-
<optional>true</optional>
111-
</dependency>
112106
<dependency>
113107
<groupId>com.alibaba</groupId>
114108
<artifactId>fastjson</artifactId>

rm-datasource/src/main/java/io/seata/rm/datasource/undo/UndoLogParserFactory.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import io.seata.common.loader.EnhancedServiceLoader;
1919
import io.seata.common.util.CollectionUtils;
20+
import io.seata.common.util.StringUtils;
2021

2122
import java.util.concurrent.ConcurrentHashMap;
2223
import java.util.concurrent.ConcurrentMap;
@@ -58,6 +59,10 @@ public static UndoLogParser getInstance() {
5859
* @return the UndoLogParser
5960
*/
6061
public static UndoLogParser getInstance(String name) {
62+
if (StringUtils.equalsIgnoreCase("fst", name)) {
63+
throw new IllegalArgumentException(
64+
"Since fst is no longer maintained, this serialization extension has been removed from version 2.0 for security and stability reasons.");
65+
}
6166
return CollectionUtils.computeIfAbsent(INSTANCES, name,
6267
key -> EnhancedServiceLoader.load(UndoLogParser.class, name));
6368
}

rm-datasource/src/main/java/io/seata/rm/datasource/undo/parser/FstSerializerFactory.java

Lines changed: 0 additions & 55 deletions
This file was deleted.

rm-datasource/src/main/java/io/seata/rm/datasource/undo/parser/FstUndoLogParser.java

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)