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

database/sql: improve documentation for DB.Close() (graceful close or not) #23753

Closed
pjebs opened this issue Feb 9, 2018 · 7 comments
Closed

database/sql: improve documentation for DB.Close() (graceful close or not) #23753

pjebs opened this issue Feb 9, 2018 · 7 comments

Comments

@pjebs
Copy link
Contributor

@pjebs pjebs commented Feb 9, 2018

The documentation doesn't make clear what DB.Close() does.

Does it close the Pool immediately even if there are still queries happening in some of the connections, or does it wait for the queries to finish and gradually closes the connections and then closes the pool?

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Feb 9, 2018

It's generally best to ask questions in a forum, which is where more people will see them. See https://golang.org/wiki/Questions .

I don't actually know the answer to this.

@dgryski
Copy link
Contributor

@dgryski dgryski commented Feb 9, 2018

/cc @kardianos

Maybe retitle: database/sql: improve documentation for DB.Close()

@kardianos
Copy link
Contributor

@kardianos kardianos commented Feb 9, 2018

That's reasonable doc request. I'll look into.

@pjebs pjebs changed the title DB.Close() ? database/sql: improve documentation for DB.Close() (graceful close or not) Feb 9, 2018
@pjebs
Copy link
Contributor Author

@pjebs pjebs commented Feb 13, 2018

I was wondering what the answer was to this question?

@ianlancetaylor ianlancetaylor added this to the Go1.11 milestone Mar 28, 2018
@gopherbot
Copy link

@gopherbot gopherbot commented Mar 29, 2018

Change https://golang.org/cl/103397 mentions this issue: database/sql: clarify behavior of DB.Close

@kardianos
Copy link
Contributor

@kardianos kardianos commented Mar 29, 2018

@pjebs Can you inspect the above CL and see if that answers your question?

@pjebs
Copy link
Contributor Author

@pjebs pjebs commented Mar 30, 2018

Answers the question.

@pjebs pjebs closed this Mar 30, 2018
gopherbot pushed a commit that referenced this issue Apr 11, 2018
It wasn't clear for existing docs if DB.Close forcefully closed
connections or waited for them to finish.

Fixes #23753

Change-Id: Id7df31224c93181c8d01bab7b0b23da25b42a288
Reviewed-on: https://go-review.googlesource.com/103397
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@golang golang locked and limited conversation to collaborators Mar 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.