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

Patch to fix hanging on unhandled exceptions #100

Merged
merged 4 commits into from
Jun 24, 2017
Merged

Conversation

bigtunacan
Copy link
Contributor

PG would hang indefinitely if an exception was raised, but not handled. This is due to @end not being set to true when this occurs so while attempting to process the result_set it gets caught in an infinite loop.

Issues related can be seen at

#98
crystal-lang/crystal-db#46
Crecto/crecto#76

@fridgerator
Copy link

Great!

@drujensen
Copy link

@bigtunacan Sweet!

@bcardiff
Copy link
Collaborator

@bigtunacan great! Could you add a spec for this?

@bigtunacan
Copy link
Contributor Author

@bcardiff no problem

@bigtunacan
Copy link
Contributor Author

@bcardiff Done.


result = PG_DB.query "insert into contacts values ($1)", "Foo"
result = PG_DB.query "insert into contacts values ($1)", "Foo" do |rs|
pp rs
Copy link
Collaborator

Choose a reason for hiding this comment

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

pp rs puts debug leftover ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

doh!

@bcardiff updated.

Copy link
Collaborator

@bcardiff bcardiff left a comment

Choose a reason for hiding this comment

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

LGTM cc: @will

@will will merged commit 17e361c into will:master Jun 24, 2017
@will
Copy link
Owner

will commented Jun 24, 2017

Thanks for working on this!

@bigtunacan
Copy link
Contributor Author

@will Glad to help. Thanks for the shard.

@bigtunacan bigtunacan mentioned this pull request Jun 24, 2017
@z64 z64 mentioned this pull request Aug 27, 2017
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.

5 participants