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

bug: Lock competition occurs in planItem statistical logic #237

Closed
Tracked by #263
binyu1005 opened this issue Jun 15, 2023 · 0 comments · Fixed by arextest/arex-api#204
Closed
Tracked by #263

bug: Lock competition occurs in planItem statistical logic #237

binyu1005 opened this issue Jun 15, 2023 · 0 comments · Fixed by arextest/arex-api#204
Assignees
Labels
bug Something isn't working
Milestone

Comments

@binyu1005
Copy link
Collaborator

Description

The system synchronizes data to the database every 5 seconds, and each synchronization currently takes 3-4 seconds, which leads to the problem of lock competition.

"scheduling-1" id=207
scheduling-1 id=207 RUNNABLE (in native) on
at java.base@11.0.14.1/java.net.SocketInputStream.socketRead0(Native Method)
at java.base@11.0.14.1/java.net.SocketInputStream.socketRead(SocketInputStream.java:115)
at java.base@11.0.14.1/java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.base@11.0.14.1/java.net.SocketInputStream.read(SocketInputStream.java:140)
at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:109)
at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:131)
at com.mongodb.internal.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:718)
at com.mongodb.internal.connection.InternalStreamConnection.receiveMessageWithAdditionalTimeout(InternalStreamConnection.java:576)
at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:415)
at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:342)
at com.mongodb.internal.connection.UsageTrackingInternalConnection.sendAndReceive(UsageTrackingInternalConnection.java:116)
at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection.sendAndReceive(DefaultConnectionPool.java:647)
at com.mongodb.internal.connection.CommandProtocolImpl.execute(CommandProtocolImpl.java:71)
at com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:244)
at com.mongodb.internal.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:227)
at com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:127)
at com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:117)
at com.mongodb.internal.connection.DefaultServer$OperationCountTrackingConnection.command(DefaultServer.java:348)
at com.mongodb.internal.operation.CommandOperationHelper.lambda$executeRetryableWrite$15(CommandOperationHelper.java:411)
at com.mongodb.internal.operation.CommandOperationHelper$$Lambda$2865/0x00007fcb64c0cc40.apply(Unknown Source)
at com.mongodb.internal.operation.OperationHelper.lambda$withSourceAndConnection$2(OperationHelper.java:564)
at com.mongodb.internal.operation.OperationHelper$$Lambda$1563/0x00007fcb67f050b0.apply(Unknown Source)
at com.mongodb.internal.operation.OperationHelper.withSuppliedResource(OperationHelper.java:589)
at com.mongodb.internal.operation.OperationHelper.lambda$withSourceAndConnection$3(OperationHelper.java:563)
at com.mongodb.internal.operation.OperationHelper$$Lambda$1555/0x00007fcb67f0b4b0.apply(Unknown Source)
at com.mongodb.internal.operation.OperationHelper.withSuppliedResource(OperationHelper.java:589)
at com.mongodb.internal.operation.OperationHelper.withSourceAndConnection(OperationHelper.java:562)
at com.mongodb.internal.operation.CommandOperationHelper.lambda$executeRetryableWrite$16(CommandOperationHelper.java:395)
at com.mongodb.internal.operation.CommandOperationHelper$$Lambda$2843/0x00007fcb64bc5440.get(Unknown Source)
at com.mongodb.internal.async.function.RetryingSyncSupplier.get(RetryingSyncSupplier.java:65)
at com.mongodb.internal.operation.CommandOperationHelper.executeRetryableWrite(CommandOperationHelper.java:423)
at com.mongodb.internal.operation.BaseFindAndModifyOperation.execute(BaseFindAndModifyOperation.java:70)
at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:212)
at com.mongodb.client.internal.MongoCollectionImpl.executeFindOneAndUpdate(MongoCollectionImpl.java:754)
at com.mongodb.client.internal.MongoCollectionImpl.findOneAndUpdate(MongoCollectionImpl.java:734)
at org.springframework.data.mongodb.core.MongoTemplate$FindAndModifyCallback.doInCollection(MongoTemplate.java:3084)
at org.springframework.data.mongodb.core.MongoTemplate$FindAndModifyCallback.doInCollection(MongoTemplate.java:3045)
at org.springframework.data.mongodb.core.MongoTemplate.executeFindOneInternal(MongoTemplate.java:2798)
at org.springframework.data.mongodb.core.MongoTemplate.doFindAndModify(MongoTemplate.java:2718)
at org.springframework.data.mongodb.core.MongoTemplate.findAndModify(MongoTemplate.java:1028)
at org.springframework.data.mongodb.core.MongoTemplate.findAndModify(MongoTemplate.java:1003)
at com.arextest.web.core.repository.mongo.ReportPlanItemStatisticRepositoryImpl.updatePlanItems(ReportPlanItemStatisticRepositoryImpl.java:72)
at com.arextest.web.core.business.StatisticService.report(StatisticService.java:129)
at com.arextest.web.api.service.schedule.StatisticSchedule.planItemSchedule(StatisticSchedule.java:26)
at jdk.internal.reflect.GeneratedMethodAccessor1248.invoke(Unknown Source)
at java.base@11.0.14.1/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base@11.0.14.1/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:95)
at java.base@11.0.14.1/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base@11.0.14.1/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base@11.0.14.1/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base@11.0.14.1/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base@11.0.14.1/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base@11.0.14.1/java.lang.Thread.run(Thread.java:829)

@binyu1005 binyu1005 added the 0630 label Jun 15, 2023
@binyu1005 binyu1005 self-assigned this Jun 15, 2023
@binyu1005 binyu1005 mentioned this issue Jun 27, 2023
13 tasks
@lijing-22 lijing-22 added bug Something isn't working and removed 0.4.0 labels Sep 12, 2023
@lijing-22 lijing-22 added this to the 0.4.0 milestone Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants