-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
对于PostgreSQL,传递了错误的connectTimeout #5096
Comments
https://github.com/pgjdbc/pgjdbc/blob/2b90ad04696324d107b65b085df4b1db8f6c162d/README.md |
there will be corrected by two steps:
|
DruidDataSource::init() if (connectTimeout == 0) { 这个怎么还没改? |
loginTimeout in milliseconds, socketTimeout in seconds fix alibaba#5096 Postgres modify timeout value unit from milliseconds to seconds wrong field assignment
loginTimeout in second , socketTimeout in millisecond fix alibaba#5096 Postgres modify timeout value unit from milliseconds to seconds wrong field assignment
loginTimeout in second , socketTimeout in millisecond fix alibaba#5096 Postgres modify timeout value unit from milliseconds to seconds wrong field assignment
fixed now: 06b8ac1 |
请使用 1.2.21验证 |
1.2.21,it happended again |
1.2.21 我的报错也还在 |
pg的什么版本驱动,我记得之前修复过这个问题。
DerrickRoseCode ***@***.***> 于2024年10月23日周三 11:43写道:
… 1.2.21 我的报错也还在
—
Reply to this email directly, view it on GitHub
<#5096 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGFEVBGK3SGOUDZWQHWOUDZ44LOJAVCNFSM6AAAAABQN3A3OWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZQG44TQOBXGA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
在DruidAbstractDataSource中 的 createPhysicalConnection 方法中,
if (driver != null && "org.postgresql.Driver".equals(driver.getClass().getName())) {
if (connectTimeoutStr == null) {
connectTimeoutStr = Integer.toString(connectTimeout);
}
physicalConnectProperties.put("loginTimeout", connectTimeoutStr);
当数据库时 postgresql时,使用connectTimeout的值传递 loginTimeout 属性至 postgresql的Driver中,用以创建物理连接,但org.postgresql.Driver 中会将 loginTimeout认为是以秒单位,详见方法 Driver中的 private static long timeout(Properties props) 方法
The text was updated successfully, but these errors were encountered: