Terrible synchronized method blocking in application.

50 views
Skip to first unread message

Jeremy Whiting

unread,
Apr 21, 2022, 12:55:57 AM4/21/22
to H2 Database
Hi,
 I am seeing the Gerrit application with terrible performance. One of the bottlenecks is this call path. Which is caused by an instrumentation project calling an unsupported method on the Connection.isWrappedFor method.

Stack Trace    Count    Percentage
String org.h2.message.TraceSystem.format(String, String)    194278    97.4 %
void org.h2.message.TraceSystem.write(int, String, String, Throwable)    194278    97.4 %
void org.h2.message.Trace.error(Throwable, String)    194278    97.4 %
SQLException org.h2.message.TraceObject.logAndConvert(Exception)    194278    97.4 %
SQLException org.h2.message.TraceObject.unsupported(String)    194278    97.4 %
boolean org.h2.jdbc.JdbcConnection.isWrapperFor(Class)    194278    97.4 %
Connection io.opentelemetry.javaagent.instrumentation.jdbc.JdbcUtils.connectionFromStatement(Statement)    194278    97.4 %
DbRequest io.opentelemetry.javaagent.instrumentation.jdbc.DbRequest.create(Statement, String)    194278    97.4 %
DbRequest io.opentelemetry.javaagent.instrumentation.jdbc.DbRequest.create(PreparedStatement)    194278    97.4 %
int org.h2.jdbc.JdbcPreparedStatement.executeUpdate()    102517    51.4 %


 I have a proposal. That the trace message be logged with a level of Info rather than Error.
 The change is best added here to the control flow


 Checking for an errorcode of 50100.

 Does this proposal to change the trace level pose concerns ?

Regards,
Jeremy

Evgenij Ryazanov

unread,
Apr 21, 2022, 2:57:21 AM4/21/22
to H2 Database
Hello!

This method is implemented since H2 1.4.181 Beta released in 2014, only older versions call TraceObject.unsupported() from it. It means that application uses some outdated and unsupported version of H2.

Jeremy Whiting

unread,
Apr 21, 2022, 6:21:57 AM4/21/22
to H2 Database
 Hi,
  Yes it will be outdated version of H2.
  Thanks for letting me know it's an unsupported version.

Jeremy
Reply all
Reply to author
Forward
0 new messages