Skip to content

Fixes crash in queries that timeout #351

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

Merged
merged 1 commit into from
Apr 27, 2023
Merged

Conversation

fabianfett
Copy link
Collaborator

@fabianfett fabianfett commented Apr 27, 2023

Fixes #347.

In an ideal case I add a unit test for this as well, but sadly this is rather involved.

cc @trasch.

Comment on lines +276 to +278
let rowStream = self.rowStream!
self.rowStream = nil
rowStream.receive(completion: .failure(error))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Reentrancy bugs are the best!

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @fabianfett ! But now a got a different error 😃 :
PostgresNIO/PostgresChannelHandler.swift:276: Fatal error: Unexpectedly found nil while unwrapping an Optional value

I hope that I can free up some time later today and have a look.

BTW is there a good way to see what query is currently running on the connection?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Lovely. Can you get me another repro? Happy to fix that one for you as well?

@codecov-commenter
Copy link

codecov-commenter commented Apr 27, 2023

Codecov Report

Merging #351 (590cd5d) into main (1516e0c) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

❗ Current head 590cd5d differs from pull request most recent head 3b1db96. Consider uploading reports for the commit 3b1db96 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #351      +/-   ##
==========================================
- Coverage   41.20%   41.19%   -0.01%     
==========================================
  Files         117      117              
  Lines        9657     9658       +1     
==========================================
  Hits         3979     3979              
- Misses       5678     5679       +1     
Impacted Files Coverage Δ
...urces/PostgresNIO/New/PostgresChannelHandler.swift 61.93% <0.00%> (-0.14%) ⬇️

@fabianfett fabianfett merged commit 6e993d5 into vapor:main Apr 27, 2023
@fabianfett fabianfett deleted the ff-fix-347 branch April 27, 2023 08:00
@fabianfett fabianfett mentioned this pull request Apr 27, 2023
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.

Crash when using 'SET statement_timeout=x'
4 participants