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
Labels
Documentation Issues describing a change to documentation. FrozenDueToAge
Milestone

Comments

@pjebs
Copy link
Contributor

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
Member

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 commented Feb 9, 2018

/cc @kardianos

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

@kardianos
Copy link
Contributor

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
@gopherbot gopherbot added the Documentation Issues describing a change to documentation. label Feb 9, 2018
@pjebs
Copy link
Contributor Author

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
Contributor

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

@kardianos
Copy link
Contributor

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

@pjebs
Copy link
Contributor Author

pjebs commented Mar 30, 2018

Answers the question.

@pjebs pjebs closed this as completed 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.
Labels
Documentation Issues describing a change to documentation. FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

5 participants