You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "LegGasai (via GitHub)" <gi...@apache.org> on 2024/12/03 08:46:05 UTC
[PR] bugfix: fix tablemeta refresh after closed [incubator-seata]
LegGasai opened a new pull request, #7044:
URL: https://github.com/apache/incubator-seata/pull/7044
<!-- Please make sure you have read and understood the contributing guidelines -->
- [ ] I have registered the PR [changes](../changes).
#7042
### Ⅰ. Describe what this PR did
### Ⅱ. Does this pull request fix one issue?
<!-- If that, add "fixes #xxx" below in the next line, for example, fixes #97. -->
### Ⅲ. Why don't you add test cases (unit test/integration test)?
### Ⅳ. Describe how to verify it
### Ⅴ. Special notes for reviews
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] bugfix: fix tablemeta refresh after closed [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes merged PR #7044:
URL: https://github.com/apache/incubator-seata/pull/7044
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] bugfix: fix tablemeta refresh after closed [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #7044:
URL: https://github.com/apache/incubator-seata/pull/7044#discussion_r1867706186
##########
rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java:
##########
@@ -142,7 +161,15 @@ static class TableMetaRefreshHolder {
});
}
-
-
+ /**
+ * Helper method to determine if the exception is caused by the data source being closed.
+ *
+ * @param ex the SQLException to check
+ * @return true if the exception indicates the data source is closed; false otherwise
+ */
+ private boolean isDataSourceClosedException(SQLException ex) {
Review Comment:
If it's just the connection being closed, can the two be distinguished?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] bugfix: fix tablemeta refresh after closed [incubator-seata]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #7044:
URL: https://github.com/apache/incubator-seata/pull/7044#issuecomment-2513934343
## [Codecov](https://app.codecov.io/gh/apache/incubator-seata/pull/7044?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
Attention: Patch coverage is `0%` with `12 lines` in your changes missing coverage. Please review.
> Project coverage is 52.76%. Comparing base [(`db1567c`)](https://app.codecov.io/gh/apache/incubator-seata/commit/db1567c466ce900fa33254b33738ef12b8fe9423?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`23fd5a0`)](https://app.codecov.io/gh/apache/incubator-seata/commit/23fd5a091b8fc1a08a9bdf35037bf37e0e032a95?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
| [Files with missing lines](https://app.codecov.io/gh/apache/incubator-seata/pull/7044?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...m/datasource/sql/struct/TableMetaCacheFactory.java](https://app.codecov.io/gh/apache/incubator-seata/pull/7044?src=pr&el=tree&filepath=rm-datasource%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Frm%2Fdatasource%2Fsql%2Fstruct%2FTableMetaCacheFactory.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cm0tZGF0YXNvdXJjZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvcm0vZGF0YXNvdXJjZS9zcWwvc3RydWN0L1RhYmxlTWV0YUNhY2hlRmFjdG9yeS5qYXZh) | 0.00% | [12 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-seata/pull/7044?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/incubator-seata/pull/7044?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## 2.x #7044 +/- ##
============================================
- Coverage 52.77% 52.76% -0.02%
- Complexity 6639 6640 +1
============================================
Files 1126 1126
Lines 40107 40119 +12
Branches 4697 4701 +4
============================================
+ Hits 21167 21169 +2
- Misses 16928 16939 +11
+ Partials 2012 2011 -1
```
| [Files with missing lines](https://app.codecov.io/gh/apache/incubator-seata/pull/7044?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...m/datasource/sql/struct/TableMetaCacheFactory.java](https://app.codecov.io/gh/apache/incubator-seata/pull/7044?src=pr&el=tree&filepath=rm-datasource%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Frm%2Fdatasource%2Fsql%2Fstruct%2FTableMetaCacheFactory.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cm0tZGF0YXNvdXJjZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvcm0vZGF0YXNvdXJjZS9zcWwvc3RydWN0L1RhYmxlTWV0YUNhY2hlRmFjdG9yeS5qYXZh) | `43.13% <0.00%> (-13.28%)` | :arrow_down: |
... and [3 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-seata/pull/7044/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] bugfix: fix tablemeta refresh after closed [incubator-seata]
Posted by "LegGasai (via GitHub)" <gi...@apache.org>.
LegGasai commented on code in PR #7044:
URL: https://github.com/apache/incubator-seata/pull/7044#discussion_r1867930808
##########
rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java:
##########
@@ -142,7 +161,15 @@ static class TableMetaRefreshHolder {
});
}
-
-
+ /**
+ * Helper method to determine if the exception is caused by the data source being closed.
+ *
+ * @param ex the SQLException to check
+ * @return true if the exception indicates the data source is closed; false otherwise
+ */
+ private boolean isDataSourceClosedException(SQLException ex) {
Review Comment:
use sqlState 08006 and exception message keywords to distinguish
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org