Skip to content
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

Serialization warnings in com.azure.cosmos.implementation.ClientSideRequestStatistics #22974

Closed
1 of 3 tasks
deepub opened this issue Jul 15, 2021 · 6 comments · Fixed by #23086
Closed
1 of 3 tasks

Serialization warnings in com.azure.cosmos.implementation.ClientSideRequestStatistics #22974

deepub opened this issue Jul 15, 2021 · 6 comments · Fixed by #23086
Labels
Client This issue points to a problem in the data-plane of the library. Cosmos customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@deepub
Copy link

deepub commented Jul 15, 2021

Describe the bug
Serialization error in com.azure.cosmos.implementation.ClientSideRequestStatistics. Seems related to
#8281

Exception or Stack Trace

Jul 14, 2021 10:00:25 PM com.fasterxml.jackson.module.afterburner.ser.OptimizedBeanPropertyWriter _reportProblem
WARNING: Disabling Afterburner serialization for class com.azure.cosmos.implementation.ClientSideRequestStatistics$SystemInformation (field #1; mutator com.fasterxml.jackson.module.afterburner.ser.StringMethodPropertyWriter), due to access error (type java.lang.IllegalAccessError, message=failed to access class com.azure.cosmos.implementation.ClientSideRequestStatistics$SystemInformation from class com.azure.cosmos.implementation.ClientSideRequestStatistics$SystemInformation$Access4JacksonSerializer204a439f (com.azure.cosmos.implementation.ClientSideRequestStatistics$SystemInformation is in unnamed module of loader 'app'; com.azure.cosmos.implementation.ClientSideRequestStatistics$SystemInformation$Access4JacksonSerializer204a439f is in unnamed module of loader com.fasterxml.jackson.module.afterburner.util.MyClassLoader @780ec4a5))

java.lang.IllegalAccessError: failed to access class com.azure.cosmos.implementation.ClientSideRequestStatistics$SystemInformation from class com.azure.cosmos.implementation.ClientSideRequestStatistics$SystemInformation$Access4JacksonSerializer204a439f (com.azure.cosmos.implementation.ClientSideRequestStatistics$SystemInformation is in unnamed module of loader 'app'; com.azure.cosmos.implementation.ClientSideRequestStatistics$SystemInformation$Access4JacksonSerializer204a439f is in unnamed module of loader com.fasterxml.jackson.module.afterburner.util.MyClassLoader @780ec4a5)
at com.azure.cosmos.implementation.ClientSideRequestStatistics$SystemInformation$Access4JacksonSerializer204a439f.stringGetter(com/azure/cosmos/implementation/ClientSideRequestStatistics$SystemInformation$Access4JacksonSerializer.java)
at com.fasterxml.jackson.module.afterburner.ser.StringMethodPropertyWriter.serializeAsField(StringMethodPropertyWriter.java:44)
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:770)
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
at com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:3126)
at com.fasterxml.jackson.core.base.GeneratorBase.writeObject(GeneratorBase.java:388)
at com.fasterxml.jackson.core.JsonGenerator.writeObjectField(JsonGenerator.java:2332)
at com.azure.cosmos.implementation.ClientSideRequestStatistics$ClientSideRequestStatisticsSerializer.serialize(ClientSideRequestStatistics.java:314)
at com.azure.cosmos.implementation.ClientSideRequestStatistics$ClientSideRequestStatisticsSerializer.serialize(ClientSideRequestStatistics.java:262)
at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:119)
at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:79)
at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:18)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4487)
at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3742)
at com.azure.cosmos.implementation.FeedResponseDiagnostics.toString(FeedResponseDiagnostics.java:79)
at java.base/java.lang.String.valueOf(String.java:3042)
at java.base/java.lang.StringBuilder.append(StringBuilder.java:168)
at com.azure.cosmos.CosmosDiagnostics.fillCosmosDiagnostics(CosmosDiagnostics.java:106)
at com.azure.cosmos.CosmosDiagnostics.toString(CosmosDiagnostics.java:62)
at java.base/java.lang.String.valueOf(String.java:3042)
at java.base/java.io.PrintStream.println(PrintStream.java:897)
at com.csconsulting.cosmos.demo.CRUDDemo.lambda$queryDocs$1(CRUDDemo.java:125)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at com.csconsulting.cosmos.demo.CRUDDemo.lambda$queryDocs$2(CRUDDemo.java:121)
at java.base/java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:104)
at java.base/java.util.stream.IntPipeline$Head.forEach(IntPipeline.java:593)
at com.csconsulting.cosmos.demo.CRUDDemo.queryDocs(CRUDDemo.java:112)
at com.csconsulting.cosmos.demo.CRUDDemo.main(CRUDDemo.java:28)

To Reproduce
Occurs when I attempt to add the following line of code using v4.16.0 SDK:
System.out.println(jsonNodeFeedResponse.getCosmosDiagnostics());
I am able to reproduce this issue in the v4.17.0 SDK too.

Code Snippet
private static void queryDocs(CosmosContainer container, int count) {

    IntStream.range(1, count)
            .forEach(
                    counter -> {
                        CosmosQueryRequestOptions queryOptions = new CosmosQueryRequestOptions();
                        queryOptions.setQueryMetricsEnabled(true);
                        String sql = "SELECT * FROM coll WHERE coll.id = " + "\"" + CONST_KEY_PREFIX + counter + "\"";
                        System.out.println(sql);
                        CosmosPagedIterable<JsonNode> pagedIterable = container.queryItems(sql, queryOptions, JsonNode.class);
                        pagedIterable.iterableByPage(10)
                                .forEach(jsonNodeFeedResponse -> {
                                    System.out.println(jsonNodeFeedResponse.getResults().get(0));
                                    System.out.println("Request Charges = " + jsonNodeFeedResponse.getRequestCharge() + "RUs"
                                    + " and Duration = " + jsonNodeFeedResponse.getCosmosDiagnostics().getDuration());

                                    //Offending line of code below. Commenting out this line eliminates the warnings
                                    System.out.println(jsonNodeFeedResponse.getCosmosDiagnostics());

                        });

                    }
            );

Expected behavior
Adding the getCosmosDiagnostics() call shouldn't result in warnings.

Screenshots
If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

  • OS: [macOS]
  • IDE: [IntelliJ]
  • Library/Libraries: [com.azureazure-cosmos:4.17.0]

Additional context
Add any other context about the problem here.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jul 15, 2021
@deepub deepub changed the title [BUG] Serialization warnings in com.azure.cosmos.implementation.ClientSideRequestStatistics Jul 15, 2021
@joshfree joshfree added Client This issue points to a problem in the data-plane of the library. Cosmos labels Jul 15, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Jul 15, 2021
@joshfree
Copy link
Member

@simplynaveen20 / @kushagraThapar could you please follow up?

@kushagraThapar
Copy link
Member

@simplynaveen20 - can you please take a look at this ?

@deepub - what Java version are you using ?
I am on Java 11 and unable to reproduce this on my local macOS machine.

@deepub
Copy link
Author

deepub commented Jul 16, 2021

Hi @kushagraThapar ,

I am running Java 16 on my macOS laptop.

openjdk 16 2021-03-16
OpenJDK Runtime Environment (build 16+36-2231)
OpenJDK 64-Bit Server VM (build 16+36-2231, mixed mode, sharing)

@deepub
Copy link
Author

deepub commented Jul 20, 2021

Hi @kushagraThapar , @simplynaveen20 ,
Any updates on this? Do you folks see this issue on jdk 16?

Thanks!

@simplynaveen20
Copy link
Member

Looking into it today

simplynaveen20 added a commit to simplynaveen20/azure-sdk-for-java that referenced this issue Jul 20, 2021
simplynaveen20 added a commit that referenced this issue Jul 21, 2021
* Fixing #22974

* Fixing afterburner issue from client side request statics and using new mapper for tracer/feedDiagnostics/cosmospageflux

* adding remaining getter in ClientSideRequestStatistics
@deepub
Copy link
Author

deepub commented Jul 23, 2021

Thanks @simplynaveen20 and @kushagraThapar !

@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Cosmos customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants