-
-
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.
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. ```
…essTypeRoles associated for CaseTypeId (#1468) * Changes so easy to run single FT * Using PropertyNamingStrategies.SnakeCaseStrategy because of c.f.j.d.PropertyNamingStrategy$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. * changes to query for POST /retrieve-access-types does retrieve AccessType and AccessTypeRoles associated for CaseTypeId * FT for multiple jurisdiction and removing accessType (multiple) versionsfor POST /retrieve-access-types does retrieve AccessType and AccessTypeRoles associated for CaseTypeId * removed as commited by mistake * Update build.gradle revert version To check if tests pass and not get the json parser error * fix for error Errror at ✽.an appropriate test context as detailed in the test data source(file:///Users/ilapatel/Documents/Work/repos/ccd-definition-store-api/aat/src/aat/resources/features/F-082/F-082.feature:7) Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('{' (code 123)): was expecting double-quote to start field name at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 69, column: 13] at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:2481) * Modified FT 110.6 * CCD-test-definition using CCD_BEFTA_RM_CT_JURISDICTION1 which has cast_type removed and Modified FT 110.1a * CCD-test-definition using CCD_BEFTA_RM_CT_JURISDICTION1 which has cast_type removed and Modified FT 110.1a * Version change CCD-test-definition using CCD_BEFTA_RM_CT_JURISDICTION1 which has cast_type removed and Modified FT 110.1a * remove mistaken typeo * empty commit to trigger build * version change for ccd-test-definition * Fixing ERROR [main] uk.gov.hmcts.befta.util.MapVerifierjava.lang.NullPointerException: Cannot invoke "Object.toString()" because "idElementValue" is null * Fix for `__elementId__` to field 'accessTypes.roles * Fix for `__elementId__` to field 'accessTypes.roles * Fix for `__elementId__` to field 'accessTypes.roles * Fix Failed FT's * Fix Failed FT's * Ccd 5647 mismatch for CCD-5233 (#1494) * version bump + Missing bits + spelling typo * Change roles to ordered * changed Respondant to Respondent * changed Respondant to Respondent * changed Respondant to Respondent * empty commit to trigger build * channged ordering and caseType name * changed ordering and caseType name * changed ordering and caseType name * empty commit to trigger build * changed ordering and caseType name * changed ordering and caseType name * Use pr-1468 instead of pr-575 and ccd-data-store-api-pr-2462-es-master instead of ccd-data-store-api-pr-1260-es-master * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * ordered ordering changed and outputing env.DEFINITION_STORE_URL_BASE * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * reverted ordering as pipeline complaining * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * added checkstyle * Changing the order * Changing the order * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * revert change to be same as master * use ccd-data-store-api-pr-2472-es-master * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * change order as @F-080 @S-080.1 FT test fails as it is expecting ordered response * change order as @F-080 @S-080.1 FT test fails as it is expecting ordered response * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build * empty commit to trigger build --------- Co-authored-by: Dinesh Patel <dinesh1.patel@btinternet.com> Co-authored-by: RebeccaBaker <38425793+RebeccaBaker@users.noreply.github.com> Co-authored-by: bharatkumarpatel1 <Bharatkumar.Patel1@HMCTS.NET>
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: