-
Notifications
You must be signed in to change notification settings - Fork 327
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
Kamon emits invalid bytecode when instrumenting sqlite versions > 3.32.3.2 #1008
Comments
This is more of a temporary workaround than a fix. It disables instrumentation on the non-prepared statement versions of queries
This is more of a temporary workaround than a fix. It disables instrumentation on the non-prepared statement versions of queries
This is more of a temporary workaround than a fix. It disables instrumentation on the non-prepared statement versions of queries
This is more of a temporary workaround than a fix. It disables instrumentation on the non-prepared statement versions of queries
@dpsoft can you offer some assistance here? |
@SimunKaracic @Falmarri Hi guys!, any running example? |
Are our tests enough? |
I've just found a workaround, but i want to understand the underlying reason of the error. |
Hmmm, I'm trying to instrument a Redis client, and I'm getting the same error. Can you post the workaround while you're trying to get to the root cause? |
Hey @SimunKaracic long story short: change this @Advice.OnMethodEnter(suppress = classOf[Throwable])
@Advice.OnMethodExit(onThrowable = classOf[Throwable], suppress = classOf[Throwable]) for @Advice.OnMethodEnter
@Advice.OnMethodExit(onThrowable = classOf[Throwable]) I'm investigating why the emitted code is invalid e.g. with suppresspublic boolean execute(String string) throws SQLException {
boolean bl;
boolean bl2;
Option option;
block8: {
Option option2;
try {
option2 = StatementExecuteMethodAdvisor$.MODULE$.executeStart((Object)this, string);
}
catch (Throwable throwable) {
LoggerHandler.error((String)"An error occurred while trying to apply an advisor", (Throwable)throwable);
option2 = null;
}
option = option2;
JDBC3Statement jDBC3Statement = this;
String sql = string;
try {
this.internalClose();
ExtendedCommand.SQLExtension ext = ExtendedCommand.parse((String)sql);
if (ext != null) {
ext.execute(this.conn.getDatabase());
bl2 = false;
break block8;
}
this.sql = sql;
this.conn.getDatabase().prepare((CoreStatement)this);
bl2 = this.exec();
}
catch (Throwable throwable) {
bl = false;
}
}
bl = bl2;
Object var4_5 = null;
try {
StatementExecuteMethodAdvisor$.MODULE$.executeEnd(option, (Throwable)var4_5);
}
catch (Throwable throwable) {
LoggerHandler.error((String)"An error occurred while trying to apply an advisor", (Throwable)throwable);
}
if (var4_5 != null) {
throw var4_5;
}
return bl;
} whithout public boolean execute(String string) throws SQLException {
boolean bl;
boolean bl2;
Option option;
block4: {
option = StatementExecuteMethodAdvisor$.MODULE$.executeStart((Object)this, string);
JDBC3Statement jDBC3Statement = this;
String sql = string;
try {
this.internalClose();
ExtendedCommand.SQLExtension ext = ExtendedCommand.parse((String)sql);
if (ext != null) {
ext.execute(this.conn.getDatabase());
bl2 = false;
break block4;
}
this.sql = sql;
this.conn.getDatabase().prepare((CoreStatement)this);
bl2 = this.exec();
}
catch (Throwable throwable) {
bl = false;
}
}
bl = bl2;
Object var4_5 = null;
StatementExecuteMethodAdvisor$.MODULE$.executeEnd(option, (Throwable)var4_5);
if (var4_5 != null) {
throw var4_5;
}
return bl;
} Reviewing all this I think that also we need a mechanism in kanela to configure the I will continue investigating a little and try with the latest version of kanela(last bytebuddy version) in order to found something... |
Great, the workaround worked 🧙 |
Fixed in 2.1.19 |
See thread here https://gitter.im/kamon-io/Kamon?at=60823ed7a2ac0d38e7d277ef
The text was updated successfully, but these errors were encountered: