csthomas1 opened a new pull request #9979:
URL: https://github.com/apache/pulsar/pull/9979


   
   
   
   
   
   <!--
   ### Contribution Checklist
     
     - Name the pull request in the form "[Issue XYZ][component] Title of the 
pull request", where *XYZ* should be replaced by the actual issue number.
       Skip *Issue XYZ* if there is no associated github issue for this pull 
request.
       Skip *component* if you are unsure about which is the best component. 
E.g. `[docs] Fix typo in produce method`.
   
     - Fill out the template below to describe the changes contributed by the 
pull request. That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue, not mix up code from 
multiple issues.
     
     - Each commit in the pull request has a meaningful commit message
   
     - Once all items of the checklist are addressed, remove the above text and 
this checklist, leaving only the filled out template below.
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   *(If this PR fixes a github issue, please add `Fixes #<xyz>`.)*
   
   Fixes #9946
   
   ### Motivation
   
   I'm able to successfully deploy in Pulsar a Pulsar function that includes a 
':' as part of its function name. When I later try to delete the function 
deployment, the Pulsar broker ends up crashing with an IllegalArgumentException 
in its log stating "Invalid format for fully qualified instance name: :". If 
the KubernetesRuntime is configured, this prevents deletion of the function's 
statefulset.
   
   Since pulsar accepts a function name that includes ':' during creation, it 
should support it during deletion as well.
   
   ### Modifications
   
   - Changed org.apache.pulsar.functions.utils.FunctionInstanceId constructor 
to split on the last colon in the function name, so that it both retrieves the 
instanceId and tolerates the presence of colons in the function name
   - Added unit test org.apache.pulsar.functions.utils.FunctionInstanceIdTest 
to validate parsing
   
   ### Verifying this change
   
   This change added tests and can be verified as follows:
   
   
**pulsar-functions/utils/src/test/java/org/apache/pulsar/functions/utils/FunctionInstanceIdTest**
     - *Added test to verify parsing of / delimiters*
     - *Added test to verify parsing of instanceId*
     - *Added test to verify successful parsing of function names that include 
colons*
   
   ### Documentation
   
     - Does this pull request introduce a new feature? no
   


-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to