-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PropertyNamingStrategy
class initialization depends on its subclass, this can lead to class loading deadlock
#2715
Comments
Interesting. Thank you for reporting this, sounds like a potentially severe issue. Do you know version of Jackson problem was encountered with? (AWS jdk core used relatively old version last I checked, 2.6.7?, but that was a while ago). |
Also... may be really really difficult to actually resolve, wrt backwards compatibility problems. |
As a workarround, we can change the code of aws-java-sdk-core, |
@fangwentong Yes. I think for databind itself, will probably need to introduce something like |
OK, thanks, backwards compatibility is really important,I'll create a PR to |
bypass the potential deadlock when PropertyNamingStrategy class initialization see: FasterXML/jackson-databind#2715
bypass the potential deadlock when PropertyNamingStrategy class initialization see: FasterXML/jackson-databind#2715
Unfortunately I think the solution can only go in 2.12, as I need to add |
PropertyNamingStrategy
class initialization depends on its subclass, this can lead to class loading deadlock
Also replaced Jackson's PropertyNamingStrategy deprecation: FasterXML/jackson-databind#2715
…akeCaseStrategy This has been replaced by PropertyNamingStrategies.SnakeCaseStrategy due to a possible classloader deadlock: FasterXML/jackson-databind#2715
…3634) This has been replaced by `PropertyNamingStrategies.SnakeCaseStrategy` due to a possible class loader deadlock. Refs FasterXML/jackson-databind#2715
…3634) This has been replaced by `PropertyNamingStrategies.SnakeCaseStrategy` due to a possible class loader deadlock. Refs FasterXML/jackson-databind#2715 (cherry picked from commit 710c9a7)
Problem In release 2.12, Jackson introduced `PropertyNamingStrategies` as a work-around for [#2715](FasterXML/jackson-databind#2715) which deprecated using the like `PropertyNamingStrategy` static fields. Solution Move to using the equivalent static fields in `PropertyNamingStrategies`. Result Less deprection tech-debt. Differential Revision: https://phabricator.twitter.biz/D838232
… (#3634) This has been replaced by `PropertyNamingStrategies.SnakeCaseStrategy` due to a possible class loader deadlock. Refs FasterXML/jackson-databind#2715
…ropertyNamingStrategy$SnakeCaseStrategy PropertyNamingStrategy.SnakeCaseStrategy is used but it has been deprecated due to risk of deadlock. Consider using PropertyNamingStrategies.SnakeCaseStrategy instead. See FasterXML/jackson-databind#2715 for more details.
…ropertyNamingStrategy$SnakeCaseStrategy PropertyNamingStrategy.SnakeCaseStrategy is used but it has been deprecated due to risk of deadlock. Consider using PropertyNamingStrategies.SnakeCaseStrategy instead. See FasterXML/jackson-databind#2715 for more details.
Following warning is always printed when using Iceberg REST clients: ``` PropertyNamingStrategy.KebabCaseStrategy is used but it has been deprecated due to risk of deadlock. Consider using PropertyNamingStrategies.KebabCaseStrategy instead. See FasterXML/jackson-databind#2715 for more details. ```
Following warning is always printed when using Iceberg REST clients: ``` PropertyNamingStrategy.KebabCaseStrategy is used but it has been deprecated due to risk of deadlock. Consider using PropertyNamingStrategies.KebabCaseStrategy instead. See FasterXML/jackson-databind#2715 for more details. ```
`PropertyNamingStrategy` is [deprecated](FasterXML/jackson-databind#2715) due to the possibility of class loading deadlock. This change simply switches to the recommended `PropertyNamingStrategies` equivalent.
**PR Checklist** - [x] A description of the changes is added to the description of this PR. - [ ] If there is a related issue, make sure it is linked to this PR. - [ ] If you've fixed a bug or added code that should be tested, add tests! - [ ] If you've added or modified a feature, documentation in `docs` is updated **Description of changes** `PropertyNamingStrategy` is [deprecated](FasterXML/jackson-databind#2715) due to the possibility of class loading deadlock. This change simply switches to the recommended `PropertyNamingStrategies` equivalent. Co-authored-by: Tathagata Das <tathagata.das1565@gmail.com>
**PR Checklist** - [X] A description of the changes is added to the description of this PR. - [X] If there is a related issue, make sure it is linked to this PR. - [ ] If you've fixed a bug or added code that should be tested, add tests! - [ ] If you've added or modified a feature, documentation in `docs` is updated **Description of changes** https://github.com/koalaman/shellcheck/wiki/SC2068 > Double quotes around $@ (and similarly, ${array[@]}) prevents globbing and word splitting of individual elements, while still expanding to multiple separate arguments. **Testing Changes** ``` bin/uc Please provide a entity. Usage: bin/uc <entity> <operation> [options] Entities: schema, volume, catalog, function, table By default, the client will connect to UC running locally at http://localhost:8080 To connect to specific UC server, use --server https://<host> Currently, auth using bearer token is supported. Please specify the token via --auth_token <PAT Token> For detailed help on entity specific operations, use bin/uc <entity> --help ~/unitycatalog git:[double_quote_array_expansion] bin/uc schema --help Please provide a valid sub-command for schema. Valid sub-commands for schema are: get, create, update, list, delete For detailed help on schema sub-commands, use bin/uc schema <sub-command> --help ~/unitycatalog git:[double_quote_array_expansion] bin/uc schema get --help Usage: bin/uc schema get [options] Required Params: --full_name The full name of the table. The full name is the concatenation of the catalog name, schema name, and table/volume name separated by a dot. For example, catalog_name.schema_name.table_name. Optional Params: ~/unitycatalog git:[double_quote_array_expansion] bin/uc schema list All required parameters are not provided. Usage: bin/uc schema list [options] Required Params: --catalog The name of the catalog. Optional Params: --max_results The maximum number of results to return. ~/unitycatalog git:[double_quote_array_expansion] bin/uc catelog list Invalid entity provided. Usage: bin/uc <entity> <operation> [options] Entities: schema, volume, catalog, function, table By default, the client will connect to UC running locally at http://localhost:8080 To connect to specific UC server, use --server https://<host> Currently, auth using bearer token is supported. Please specify the token via --auth_token <PAT Token> For detailed help on entity specific operations, use bin/uc <entity> --help ~/unitycatalog git:[double_quote_array_expansion] bin/uc catalog list ... ``` ``` bin/start-uc-server 44 Jul 07, 2024 10:47:24 PM com.fasterxml.jackson.databind.PropertyNamingStrategy$PropertyNamingStrategyBase <init> WARNING: PropertyNamingStrategy.KebabCaseStrategy is used but it has been deprecated due to risk of deadlock. Consider using PropertyNamingStrategies.KebabCaseStrategy instead. See FasterXML/jackson-databind#2715 for more details. ################################################################### # _ _ _ _ _____ _ _ # # | | | | (_) | / ____| | | | | # # | | | |_ __ _| |_ _ _ | | __ _| |_ __ _| | ___ __ _ # # | | | | '_ \| | __| | | | | | / _` | __/ _` | |/ _ \ / _` | # # | |__| | | | | | |_| |_| | | |___| (_| | || (_| | | (_) | (_| | # # \____/|_| |_|_|\__|\__, | \_____\__,_|\__\__,_|_|\___/ \__, | # # __/ | __/ | # # |___/ vv0.1.0-SNAPSHOT |___/ # ################################################################### #68
…been deprecated due to risk of deadlock. Consider using PropertyNamingStrategies.SnakeCaseStrategy instead. See FasterXML/jackson-databind#2715 for more details.
…y.SnakeCaseStrategy is used but it has been deprecated due to risk of deadlock. Consider using PropertyNamingStrategies.SnakeCaseStrategy instead. See FasterXML/jackson-databind#2715 for more details.
If a class refer to its subclasses in its static initializers or in static fields, this references can cause JVM-level deadlocks in multithreaded environment, when one thread tries to load superclass and another thread tries to load subclass at the same time.
See: https://bugs.openjdk.java.net/browse/JDK-8037567
The following demo code can reproduce this deadlock
When the demo program
ClassInitDeadLock
started, it could not exit automatically.Thread-A
holdingPropertyNamingStrategy
class , and waitingPascalCaseStrategy
class initialize, whileThread-B
holdingPascalCaseStrategy
class, and waitingPropertyNamingStrategy
class initialize, deadlock occurred!jstack of these two thread:
In the actual environment,
PropertyNamingStrategy
and its subclass defined in jackson-databind initialize very fast, so It's hard to produce the scene that multithread load superclass and subclass at the same time.I happened to meet this deadlock recently, It turn out to be JsonErrorUnmarshaller.java#L37 defined in
aws-java-sdk-core
, trying to initialize subclassPascalCaseStrategy
, at the same time, another thread is initilizing superclassPropertyNamingStrategy
The text was updated successfully, but these errors were encountered: