-
Notifications
You must be signed in to change notification settings - Fork 78
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
Conversation
… of result set to prevent hanging then raise with original message.
Great! |
@bigtunacan Sweet! |
@bigtunacan great! Could you add a spec for this? |
@bcardiff no problem |
@bcardiff Done. |
spec/pg/driver_spec.cr
Outdated
|
||
result = PG_DB.query "insert into contacts values ($1)", "Foo" | ||
result = PG_DB.query "insert into contacts values ($1)", "Foo" do |rs| | ||
pp rs |
There was a problem hiding this comment.
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 ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doh!
@bcardiff updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM cc: @will
Thanks for working on this! |
@will Glad to help. Thanks for the shard. |
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