Skip to content
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

Add test for proper handling of connection failure to avoid 'cannot wait on socket event without a socket' error #8231

Merged
merged 4 commits into from
Jul 2, 2024

Conversation

knizhnik
Copy link
Contributor

@knizhnik knizhnik commented Jul 2, 2024

Problem

See https://github.com/neondatabase/cloud/issues/14289
and PR #8210

Summary of changes

Add test for problems fixed in #8210

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • Do we need to implement analytics? if so did you add the relevant metrics to the dashboard?
  • If this PR requires public announcement, mark it with /release-notes label and add several sentences in this section.

Checklist before merging

  • Do not forget to reformat commit message to not include the above checklist

Copy link
Contributor

@MMeent MMeent left a comment

Choose a reason for hiding this comment

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

This does a full PS connect timeout up to an error; can we reduce that time so that we don't have a test consuming a runner's testslot for ~50 seconds?

@kelvich
Copy link
Contributor

kelvich commented Jul 2, 2024

I'll keep mentioning that we don't need https://github.com/neondatabase/neon/pull/8210/files#diff-d6b0f875ded76c09210876308df775e27adf4b424af1824c65a5d5871effe074L430-L434 now as PQstatus does the same check. Am I wrong about it or there is some reason to keep it?

Copy link

github-actions bot commented Jul 2, 2024

3006 tests run: 2891 passed, 0 failed, 115 skipped (full report)


Code coverage* (full report)

  • functions: 32.7% (6932 of 21213 functions)
  • lines: 50.0% (54306 of 108576 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
c63bc01 at 2024-07-02T17:10:58.198Z :recycle:

@knizhnik
Copy link
Contributor Author

knizhnik commented Jul 2, 2024

I'll keep mentioning that we don't need https://github.com/neondatabase/neon/pull/8210/files#diff-d6b0f875ded76c09210876308df775e27adf4b424af1824c65a5d5871effe074L430-L434 now as PQstatus does the same check. Am I wrong about it or there is some reason to keep it?

Yes, this check seems to be redundant.
PQerrorMessage also correctly handle NULL pointer.

@knizhnik
Copy link
Contributor Author

knizhnik commented Jul 2, 2024

This does a full PS connect timeout up to an error; can we reduce that time so that we don't have a test consuming a runner's testslot for ~50 seconds?

I would rather consider it as question to implementation rather then test - if there is is non-recoverable error, should we retry connection to PS? From one hand it seems to have no sense... But from the other - it is our own PS and why there is any invalids connection string? And even if somebody somehow incorrectly specify such connection string, will it be better that all backlands fail immediately or will be blocked for 50 seconds trying to reconnect to PS, making possible for "somebody" to fix the problem and revert incorrect connection string setting?

@knizhnik
Copy link
Contributor Author

knizhnik commented Jul 2, 2024

This does a full PS connect timeout up to an error; can we reduce that time so that we don't have a test consuming a runner's testslot for ~50 seconds?

Adding statement_timeout fixes this problem.

@knizhnik knizhnik force-pushed the test_for_connect_failure_handling branch from 85dfbd3 to 73c5c4f Compare July 2, 2024 14:54
@knizhnik knizhnik requested review from a team as code owners July 2, 2024 14:54
@knizhnik knizhnik requested a review from jcsp July 2, 2024 14:54
@knizhnik knizhnik merged commit 4a0c2ae into main Jul 2, 2024
64 checks passed
@knizhnik knizhnik deleted the test_for_connect_failure_handling branch July 2, 2024 18:45
VladLazar pushed a commit that referenced this pull request Jul 8, 2024
…ait on socket event without a socket' error (#8231)

## Problem

See neondatabase/cloud#14289
and PR #8210 

## Summary of changes

Add test for problems fixed in #8210

## Checklist before requesting a review

- [ ] I have performed a self-review of my code.
- [ ] If it is a core feature, I have added thorough tests.
- [ ] Do we need to implement analytics? if so did you add the relevant
metrics to the dashboard?
- [ ] If this PR requires public announcement, mark it with
/release-notes label and add several sentences in this section.

## Checklist before merging

- [ ] Do not forget to reformat commit message to not include the above
checklist

---------

Co-authored-by: Konstantin Knizhnik <knizhnik@neon.tech>
VladLazar pushed a commit that referenced this pull request Jul 8, 2024
…ait on socket event without a socket' error (#8231)

## Problem

See neondatabase/cloud#14289
and PR #8210 

## Summary of changes

Add test for problems fixed in #8210

## Checklist before requesting a review

- [ ] I have performed a self-review of my code.
- [ ] If it is a core feature, I have added thorough tests.
- [ ] Do we need to implement analytics? if so did you add the relevant
metrics to the dashboard?
- [ ] If this PR requires public announcement, mark it with
/release-notes label and add several sentences in this section.

## Checklist before merging

- [ ] Do not forget to reformat commit message to not include the above
checklist

---------

Co-authored-by: Konstantin Knizhnik <knizhnik@neon.tech>
VladLazar pushed a commit that referenced this pull request Jul 8, 2024
…ait on socket event without a socket' error (#8231)

## Problem

See neondatabase/cloud#14289
and PR #8210 

## Summary of changes

Add test for problems fixed in #8210

## Checklist before requesting a review

- [ ] I have performed a self-review of my code.
- [ ] If it is a core feature, I have added thorough tests.
- [ ] Do we need to implement analytics? if so did you add the relevant
metrics to the dashboard?
- [ ] If this PR requires public announcement, mark it with
/release-notes label and add several sentences in this section.

## Checklist before merging

- [ ] Do not forget to reformat commit message to not include the above
checklist

---------

Co-authored-by: Konstantin Knizhnik <knizhnik@neon.tech>
VladLazar pushed a commit that referenced this pull request Jul 8, 2024
…ait on socket event without a socket' error (#8231)

## Problem

See neondatabase/cloud#14289
and PR #8210 

## Summary of changes

Add test for problems fixed in #8210

## Checklist before requesting a review

- [ ] I have performed a self-review of my code.
- [ ] If it is a core feature, I have added thorough tests.
- [ ] Do we need to implement analytics? if so did you add the relevant
metrics to the dashboard?
- [ ] If this PR requires public announcement, mark it with
/release-notes label and add several sentences in this section.

## Checklist before merging

- [ ] Do not forget to reformat commit message to not include the above
checklist

---------

Co-authored-by: Konstantin Knizhnik <knizhnik@neon.tech>
VladLazar pushed a commit that referenced this pull request Jul 8, 2024
…ait on socket event without a socket' error (#8231)

## Problem

See neondatabase/cloud#14289
and PR #8210 

## Summary of changes

Add test for problems fixed in #8210

## Checklist before requesting a review

- [ ] I have performed a self-review of my code.
- [ ] If it is a core feature, I have added thorough tests.
- [ ] Do we need to implement analytics? if so did you add the relevant
metrics to the dashboard?
- [ ] If this PR requires public announcement, mark it with
/release-notes label and add several sentences in this section.

## Checklist before merging

- [ ] Do not forget to reformat commit message to not include the above
checklist

---------

Co-authored-by: Konstantin Knizhnik <knizhnik@neon.tech>
VladLazar pushed a commit that referenced this pull request Jul 8, 2024
…ait on socket event without a socket' error (#8231)

## Problem

See neondatabase/cloud#14289
and PR #8210 

## Summary of changes

Add test for problems fixed in #8210

## Checklist before requesting a review

- [ ] I have performed a self-review of my code.
- [ ] If it is a core feature, I have added thorough tests.
- [ ] Do we need to implement analytics? if so did you add the relevant
metrics to the dashboard?
- [ ] If this PR requires public announcement, mark it with
/release-notes label and add several sentences in this section.

## Checklist before merging

- [ ] Do not forget to reformat commit message to not include the above
checklist

---------

Co-authored-by: Konstantin Knizhnik <knizhnik@neon.tech>
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