[ 
https://issues.apache.org/jira/browse/SLING-13260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18095695#comment-18095695
 ] 

Roy Teeuwen edited comment on SLING-13260 at 7/12/26 12:22 PM:
---------------------------------------------------------------

[~reschke] actually it's was indeed your own mistake ;) you put it on a release 
that was already done. 2.0.4 was already staged and closed in sonatype. The 
mail for the release vote of 2.0.4 was already sent the 5th of june indeed, by 
me https://lists.apache.org/thread/gvv7lv2hsjkpkrnkcdl3nh3rw5rg60lb

That's also the reason that the automated finalizing process that I use (the 
sling committer cli) closed this ticket :), because you put it on 2.0.4 which 
was already out


was (Author: royteeuwen):
[~reschke] actually it's was indeed your own mistake ;) you put it on a release 
that was already done. 2.0.4 was already staged and closed in sonatype. The 
mail for the release vote of 2.0.4 was already sent the 5th of june indeed: 
https://lists.apache.org/thread/gvv7lv2hsjkpkrnkcdl3nh3rw5rg60lb

> Using a String instead of StandardCharset to instantiante strings requires a 
> lock 
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-13260
>                 URL: https://issues.apache.org/jira/browse/SLING-13260
>             Project: Sling
>          Issue Type: Improvement
>          Components: ResourceResolver
>            Reporter: Patrique Legault
>            Assignee: Julian Reschke
>            Priority: Minor
>             Fix For: Resource Resolver 2.0.6
>
>
> Under heavy load we see many threads locking with the following pattern [1].
> This happens because the 
> [URI|https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/master/src/main/java/org/apache/sling/resourceresolver/impl/helper/URI.java#L4022]
>  class passes a String for the Charset, this results in the String class 
> calling 
> java.lang.String.[lookup|https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/lang/String.java#L1662-L1665]
>  which locks in order to perform the lookup.
> A simple enhancement is to pass the Charset as such to prevent the 
> [lookup|https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/lang/String.java#L1690-L1692].
>  
> [1]
> {code:java}
> java.lang.Thread.State: BLOCKED (on object monitor)
>  at 
> sun.nio.cs.StandardCharsets.charsetForName([email protected]/StandardCharsets.java:1304)
>  - waiting to lock <0x000000041005a680> (a sun.nio.cs.StandardCharsets)
>  at java.nio.charset.Charset.lookup2([email protected]/Charset.java:486)
>  at java.nio.charset.Charset.lookup([email protected]/Charset.java:475)
>  at java.nio.charset.Charset.forName([email protected]/Charset.java:539)
>  at java.lang.String.lookupCharset([email protected]/String.java:848)
>  at java.lang.String.<init>([email protected]/String.java:1390)
>  at 
> org.apache.sling.resourceresolver.impl.helper.URI.getAsciiString(URI.java:4022)
>  at org.apache.sling.resourceresolver.impl.helper.URI.encode(URI.java:1776)
>  at org.apache.sling.resourceresolver.impl.helper.URI.setPath(URI.java:2938)
>  at 
> org.apache.sling.resourceresolver.impl.helper.URI.parseUriReference(URI.java:2118)
>  
> ....{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to