Closed Demilivor closed 2 months ago
Hello @an-tao
Could you please review this PR. Please feel free to suggest improvements.
Thanks for the PR! Could you put the init() methods right after the constructor? That really helps the code review. The diff viewer now displays in a stupid way...
Thanks for the PR! Could you put the init() methods right after the constructor? That really helps the code review. The diff viewer now displays in a stupid way...
Done!
My latest update failed test:
In test case PgPipelineTest
/home/admin/arenadata_drogon/drogon/orm_lib/tests/pipeline_test.cpp:37 FAILED:
Reason: PgPipelineTest_init(0) what():SQL execution timeout
I just reproduced the issue on my personal PC. I'm going to investigate this failure on Monday.
closes #1407
This PR adds automatic reconnection to the Postgres/MySQL database with 1-second interval if connection was not established instead of
exit(1)
To be noted, auto-reconnect is already supported. This exit(-1) happens on some edge cases, such as reaching open socket limits.
To be noted, auto-reconnect is already supported. This exit(-1) happens on some edge cases, such as reaching open socket limits.
From wiki
The connections managed by DbClient are always reconnected, so users don't need to care about the connection status. They are almost always connected.
The problem is not with "some edge cases" because simple drop of connection to PostgreSQL for few seconds makes the whole Drogon's application exit(-1)
.
The issue with PgPipelineTest
should be fixed now.
One more update: 1) Added connection initialization to make db_listener_test test pass.
I'm not familiar with the internal Drogon tests. Do you have a guide how I can prepare the test environment on my PC and run all Drogon tests before updating PR?
One more update:
- Added connection initialization to make db_listener_test test pass.
I'm not familiar with the internal Drogon tests. Do you have a guide how I can prepare the test environment on my PC and run all Drogon tests before updating PR?
You could refer to the github actions configuration: https://github.com/drogonframework/drogon/tree/master/.github/workflows
closes #1407
This PR adds automatic reconnection to the Postgres/MySQL database with 1-second interval if connection was not established instead of
exit(1)