-
Notifications
You must be signed in to change notification settings - Fork 112
Description
As a consequence of this problem, in my observability changes I have to invoke await this.begin() so as to ensure proper span production but @surbhigarg raised a point in a code review with
Can we hold on this change of making 'error' event async. I know this would mean that our few spans wont work correctly.
I am working on another PR to see if this check can be removed #2168Adding async here will cause other issues like in below when
runTransactionAsyncmethod tries to insert an invalid error, normally thiserrorevent is invoked first and thencatchblock. But if you addasynchere, this would makecatchblock invoked first aserrorevent is called asynchronously which will cause other issues.
try {
await database.runTransactionAsync(async transaction => {
await transaction.run(
"INSERT INTO Singers (SingerId, FirstName) VALUES (310, 'abc')"
);
await transaction.commit();
});
await database.runTransactionAsync(async transaction => {
await transaction.run(
"INSERT INTO Singers (SingerId, FirstName) VALUES (310, 'abc')"
);
await transaction.commit();
});
} catch (err) {
console.error('ERROR:', err);
// throw err;
} finally {
database.close();
}
Remove this change and add a bug where we mention what scenarios are not working and I will take it up separately.
Originally posted by @surbhigarg92 in #2158 (comment)