Skip to content

Ensure isValid() will not last more than timeout seconds#1557

Merged
davecramer merged 5 commits intopgjdbc:masterfrom
arobert-delfingen:issue/1556
Sep 5, 2019
Merged

Ensure isValid() will not last more than timeout seconds#1557
davecramer merged 5 commits intopgjdbc:masterfrom
arobert-delfingen:issue/1556

Conversation

@arobert-delfingen
Copy link
Copy Markdown
Contributor

@arobert-delfingen arobert-delfingen commented Sep 3, 2019

This PR is to just to give an idea how to fix issue #1556, but never tested

even if the underlying socket is broken (issue #1556)
@AppVeyorBot
Copy link
Copy Markdown

@davecramer
Copy link
Copy Markdown
Member

Makes sense

@davecramer
Copy link
Copy Markdown
Member

@arobert-delfingen can you rebase and push another commit as the .travis.yml file was broken, thanks

@AppVeyorBot
Copy link
Copy Markdown

@AppVeyorBot
Copy link
Copy Markdown

@davecramer
Copy link
Copy Markdown
Member

@arobert-delfingen so this is now failing most all tests, except for checkstyle ...

@AppVeyorBot
Copy link
Copy Markdown

@arobert-delfingen
Copy link
Copy Markdown
Contributor Author

Now all tests succeed, but theoritically I should :

  • Surround the 4 calls to get/setNetworkTimeout() by a try/catch (not only the last)
  • Not catch all kinds of SQLException, this is a little bit too wide, but maybe only SQLException having state PSQLState.CONNECTION_DOES_NOT_EXIST (and maybe also PSQLState.COMMUNICATION_ERROR).
    What do you think about that ?

@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #1557 into master will decrease coverage by 0.03%.
The diff coverage is 85.71%.

@@             Coverage Diff              @@
##             master    #1557      +/-   ##
============================================
- Coverage     68.92%   68.88%   -0.04%     
  Complexity     3971     3971              
============================================
  Files           179      179              
  Lines         16545    16569      +24     
  Branches       2695     2695              
============================================
+ Hits          11403    11414      +11     
- Misses         3890     3902      +12     
- Partials       1252     1253       +1

@davecramer
Copy link
Copy Markdown
Member

@arobert-delfingen yes, to all of the above. Thanks!

@AppVeyorBot
Copy link
Copy Markdown

@arobert-delfingen
Copy link
Copy Markdown
Contributor Author

Any idea why when writen like this it breaks test ? where is my mistake ?

@davecramer
Copy link
Copy Markdown
Member

I don't worry too much about Appveyor failures. If it passes Travis I'm good.

@davecramer davecramer merged commit b2eaefe into pgjdbc:master Sep 5, 2019
@AppVeyorBot
Copy link
Copy Markdown

rbrw pushed a commit to puppetlabs/puppetdb that referenced this pull request Nov 21, 2019
PostgreSQL JDBC driver has a bug where the isValid() call on a
connection does not respect timeouts. This causes our connection pool to
not detect a dead connection, which will eventually exhaust our
connection pool entirely. See pgjdbc/pgjdbc#1557
rbrw pushed a commit to puppetlabs/puppetdb that referenced this pull request Nov 22, 2019
PostgreSQL JDBC driver has a bug where the isValid() call on a
connection does not respect timeouts. This causes our connection pool to
not detect a dead connection, which will eventually exhaust our
connection pool entirely. See pgjdbc/pgjdbc#1557
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.

4 participants