You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fury.apache.org by "157152688 (via GitHub)" <gi...@apache.org> on 2024/05/10 11:18:27 UTC

[PR] ignoreEnumDeserializeError Enumerating new values, deserializing without any new enumerations, resulting in the array being out of bounds and unable to parse properly bug [incubator-fury]

157152688 opened a new pull request, #1623:
URL: https://github.com/apache/incubator-fury/pull/1623

   <!--
   **Thanks for contributing to Fury.**
   
   **If this is your first time opening a PR on fury, you can refer to [CONTRIBUTING.md](https://github.com/apache/incubator-fury/blob/main/CONTRIBUTING.md).**
   
   Contribution Checklist
   
       - The **Apache Fury (incubating)** community has restrictions on the naming of pr titles. You can also find instructions in [CONTRIBUTING.md](https://github.com/apache/incubator-fury/blob/main/CONTRIBUTING.md).
   
       - Fury has a strong focus on performance. If the PR you submit will have an impact on performance, please benchmark it first and provide the benchmark result here.
   -->
   
   ## What does this PR do?
   
   <!-- Describe the purpose of this PR. -->
   
   
   ## Related issues
   
   <!--
   Is there any related issue? Please attach here.
   
   - #xxxx0
   - #xxxx1
   - #xxxx2
   -->
   
   
   ## Does this PR introduce any user-facing change?
   
   <!--
   If any user-facing interface changes, please [open an issue](https://github.com/apache/incubator-fury/issues/new/choose) describing the need to do so and update the document if necessary.
   -->
   
   - [ ] Does this PR introduce any public API change?
   - [ ] Does this PR introduce any binary protocol compatibility change?
   
   
   ## Benchmark
   
   <!--
   When the PR has an impact on performance (if you don't know whether the PR will have an impact on performance, you can submit the PR first, and if it will have impact on performance, the code reviewer will explain it), be sure to attach a benchmark data here.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): support deserialization ignoreEnumDeserializeError [incubator-fury]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1623:
URL: https://github.com/apache/incubator-fury/pull/1623#discussion_r1597344117


##########
java/fury-core/src/main/java/org/apache/fury/serializer/EnumSerializer.java:
##########
@@ -49,7 +49,7 @@ public void write(MemoryBuffer buffer, Enum value) {
   @Override
   public Enum read(MemoryBuffer buffer) {
     int value = buffer.readVarUint32Small7();
-    if (fury.getConfig().isEnumDeserializeErrorIgnored() && value >= enumConstants.length) {
+    if (fury.getConfig().isDeserializeUnexistentEnumValueAsNull() && value >= enumConstants.length) {

Review Comment:
   ```suggestion
       if (fury.getConfig().deserializeUnexistentEnumValueAsNull() && value >= enumConstants.length) {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): support deserialization ignoreEnumDeserializeError [incubator-fury]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1623:
URL: https://github.com/apache/incubator-fury/pull/1623#discussion_r1596751051


##########
java/fury-core/src/main/java/org/apache/fury/config/Config.java:
##########
@@ -54,6 +54,7 @@ public class Config implements Serializable {
   private final boolean deserializeUnexistedClass;
   private final boolean scalaOptimizationEnabled;
   private transient int configHash;
+  private final boolean enumDeserializeErrorIgnored;

Review Comment:
   How about naming it as `deserializeUnexistentEnumValueAsNull`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): support deserialization ignoreEnumDeserializeError [incubator-fury]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1623:
URL: https://github.com/apache/incubator-fury/pull/1623#discussion_r1597348776


##########
java/fury-core/src/main/java/org/apache/fury/config/Config.java:
##########
@@ -100,6 +102,10 @@ public boolean isStringRefIgnored() {
     return stringRefIgnored;
   }
 

Review Comment:
   Add Javadoc here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): support deserialization ignoreEnumDeserializeError [incubator-fury]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1623:
URL: https://github.com/apache/incubator-fury/pull/1623#discussion_r1597348666


##########
ci/format.sh:
##########
@@ -25,6 +25,8 @@ install_nodejs() {
   node -v
   npm -v
 }
+export python=/home/t5/weijiang/work/score/fury/1/Python-3.8.18/python3.8/bin/python3.8

Review Comment:
   Remove this



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): support deserialization ignoreEnumDeserializeError [incubator-fury]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1623:
URL: https://github.com/apache/incubator-fury/pull/1623#discussion_r1597348719


##########
ci/format.sh:
##########
@@ -180,7 +182,7 @@ format_all_scripts() {
 }
 
 format_java() {
-    if command -v mvn >/dev/null ; then

Review Comment:
   Revert this



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): support deserialization ignoreEnumDeserializeError [incubator-fury]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1623:
URL: https://github.com/apache/incubator-fury/pull/1623#discussion_r1597355857


##########
java/fury-core/src/main/java/org/apache/fury/config/Config.java:
##########
@@ -100,6 +102,10 @@ public boolean isStringRefIgnored() {
     return stringRefIgnored;
   }
 
+  public boolean isDeserializeUnexistentEnumValueAsNull() {

Review Comment:
   Rename to deserializeUnexistentEnumValueAsNull



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): support deserialization ignoreEnumDeserializeError [incubator-fury]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang merged PR #1623:
URL: https://github.com/apache/incubator-fury/pull/1623


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org