You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/06/23 16:01:35 UTC

[GitHub] [pulsar] coderzc opened a new pull request, #16199: [fix][function] Ensure bytes is a well-formed UTF-8 byte sequence when decode the `FunctionState` bytes

coderzc opened a new pull request, #16199:
URL: https://github.com/apache/pulsar/pull/16199

   Fixes #16193 
   
   ### Motivation
   
   Now, if put a byte[] type state to a function, they can get an incorrect string type state using admin API.
   
   The root cause is that bytes may not be a well-formed UTF-8 byte sequence, so we should not decode it to a UTF-8 string.
   
   References: 
   [Unicode6.2.0](http://www.unicode.org/versions/Unicode6.2.0/ch03.pdf)
   
   ### Modifications
   
   Add a check the bytes whether is a well-formed UTF-8 byte sequence when decode the `FunctionState` bytes.
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   This change is already covered by existing tests, such as `testSourceByteState`, `testBytes2StringNotUTF8`
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (yes / no)
     - The public API: (yes / no)
     - The schema: (yes / no / don't know)
     - The default values of configurations: (yes / no)
     - The wire protocol: (yes / no)
     - The rest endpoints: (yes / no)
     - The admin cli options: (yes / no)
     - Anything that affects deployment: (yes / no / don't know)
   
   ### Documentation
   
   Check the box below or label this PR directly.
   
   Need to update docs? 
   
   - [x] `doc-not-needed` 
   (Please explain why)


-- 
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@pulsar.apache.org

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


[GitHub] [pulsar] nodece commented on a diff in pull request #16199: [fix][function] Ensure bytes is a well-formed UTF-8 byte sequence when decode the `FunctionState` bytes to string

Posted by GitBox <gi...@apache.org>.
nodece commented on code in PR #16199:
URL: https://github.com/apache/pulsar/pull/16199#discussion_r906161567


##########
tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarStateTest.java:
##########
@@ -38,14 +46,9 @@
 import org.apache.pulsar.tests.integration.suites.PulsarStandaloneTestSuite;
 import org.apache.pulsar.tests.integration.topologies.PulsarCluster;
 import org.awaitility.Awaitility;
+import org.testng.Assert;

Review Comment:
   Using `import static` instead of 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@pulsar.apache.org

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


[GitHub] [pulsar] codelipenghui merged pull request #16199: [fix][function] Ensure bytes is a well-formed UTF-8 byte sequence when decode the `FunctionState` bytes to string

Posted by GitBox <gi...@apache.org>.
codelipenghui merged PR #16199:
URL: https://github.com/apache/pulsar/pull/16199


-- 
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@pulsar.apache.org

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


[GitHub] [pulsar] coderzc commented on pull request #16199: [fix][function] Ensure bytes is a well-formed UTF-8 byte sequence when decode the `FunctionState` bytes to string

Posted by GitBox <gi...@apache.org>.
coderzc commented on PR #16199:
URL: https://github.com/apache/pulsar/pull/16199#issuecomment-1171041577

   /pulsarbot run-failure-checks


-- 
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@pulsar.apache.org

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


[GitHub] [pulsar] coderzc commented on pull request #16199: [fix][function] Ensure bytes is a well-formed UTF-8 byte sequence when decode the `FunctionState` bytes to string

Posted by GitBox <gi...@apache.org>.
coderzc commented on PR #16199:
URL: https://github.com/apache/pulsar/pull/16199#issuecomment-1171035571

   /pulsarbot run-failure-checks


-- 
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@pulsar.apache.org

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