Skip to content

fix: updated db instrumentations with safety promise check#2392

Merged
abhilash-sivan merged 2 commits intomainfrom
fix-safety-promise-db
Mar 10, 2026
Merged

fix: updated db instrumentations with safety promise check#2392
abhilash-sivan merged 2 commits intomainfrom
fix-safety-promise-db

Conversation

@abhilash-sivan
Copy link
Copy Markdown
Contributor

refs https://jsw.ibm.com/browse/INSTA-70534

This PR covers the remaining DB instrumentations

span.transmit();
});
} else {
tracingUtil.handleUnexpectedReturnValue(result, exports.spanName, obj[0].sql);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already we were cancelling the span on this case, so keeping the same

});
} else {
tracingUtil.handleUnexpectedReturnValue(prom, exports.spanName, sql);
span.cancel();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same cancellation logic goes here

@abhilash-sivan abhilash-sivan marked this pull request as ready for review March 6, 2026 11:12
@abhilash-sivan abhilash-sivan requested a review from a team as a code owner March 6, 2026 11:12
@abhilash-sivan abhilash-sivan force-pushed the fix-safety-promise-db branch from 61ad816 to ec8641c Compare March 6, 2026 11:12
return originalCallback.apply(this, arguments);
};
originalArgs[1] = cls.ns.bind(wrappedCallback);
return originalFunction.apply(ctx, originalArgs);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When there's a callback, we don't have to handle the promise; this way we prevent finishing the span twice

Copy link
Copy Markdown
Contributor

@aryamohanan aryamohanan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@abhilash-sivan abhilash-sivan force-pushed the fix-safety-promise-db branch from 6001131 to 69a716d Compare March 10, 2026 10:30
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
30.3% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@abhilash-sivan abhilash-sivan merged commit fb67a0f into main Mar 10, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants