Aws-sdk-java-v2: Enum deserialization is suspending the process forever when the enum value is not existent in the enum class.

Created on 17 Aug 2020  路  4Comments  路  Source: aws/aws-sdk-java-v2

When there is a data on DynamoDB with Enum value that doesn't exist on the class model that is gonna receive the deserialization, the execution process hangs forever.

Expected Behavior

An exception when deserializing an enum value that doesn't exist.

Steps to Reproduce

  • A document with a String partitionKey, an Enum with values: A and B and an LSI Instant updatedAt.
  • Make an index query with DynamoDbAsyncIndex using QueryConditional.sortBetween like:
       val queryConditional = QueryConditional.sortBetween(
            Key.builder()
                .partitionValue(partitionKey)
                .sortValue(updatedAtFrom.toString())
                .build(),
            Key.builder()
                .partitionValue(partitionKey)
                .sortValue(updatedAtTo.toString())
                .build()
        )

       myTableIndex.query(
                QueryEnhancedRequest
                    .builder()
                    .queryConditional(queryConditional)
                    .build())

Issue

The problem is in the deserialization of the enum class that doesn't have a value that is signed to a data on DynamoDB.
For this reason, the process gets running forever.

Your Environment

  • Kotlin: 1.3.72
  • Spring Boot: 2.3.1.RELEASE
  • Webflux
  • dynamodb-enhanced: 2.13.35

    • Netty: 4.1.50.Final

In my DynamoDB environment, there was a unique record with an old state called INITIALIZED that was replaced for CREATED some days ago.
When the query runs, the data cannot be deserialized in this enum and finally hangs the process forever without any exception or log.

bug needs-reproduction

All 4 comments

@eheinen how are you mapping the enum field to the DynamoDB table? Can you give a sample code of the Bean or the table schema so I can try to reproduce?

It looks like this issue hasn鈥檛 been active in longer than a week. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please add a comment to prevent automatic closure, or if the issue is already closed please feel free to reopen it.

@debora-ito Sorry my late answer, so, I build the evidence for you to check. The step by step is in the README:

https://github.com/eheinen/dynamodb-issue

Anything, just ping me.

Let me know if you manage to reproduce the issue, please.

Hi,
We had the same problem here. Is there a solution for this case?
As a solution, here we stop using DynamoDbAsyncIndex, and for do SGI research we use DynamoDbAsyncClient directly, using dynamoDbAsyncClient.query (r) ...
Using DynamoDbAsyncIndex, returns an SdkPublisher, and any problem converting from dynamo, the thread is blocked and does not complete the future.

My implementation is very similar to https://github.com/eheinen/dynamodb-issue, using webflux here too. But the problem is not the webflux, if you implement with pure java, the bug is the same.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tigertoes picture tigertoes  路  6Comments

jhovell picture jhovell  路  4Comments

vhiairrassary picture vhiairrassary  路  3Comments

david-katz picture david-katz  路  3Comments

aeons picture aeons  路  4Comments