<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/go-git.git/src/database, branch dev.cmdgo</title>
<subtitle>github.com: golang/go
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/'/>
<entry>
<title>database/sql: fix deadlock test in prepare statement</title>
<updated>2021-06-21T17:37:23+00:00</updated>
<author>
<name>Daniel Theophanes</name>
<email>kardianos@gmail.com</email>
</author>
<published>2021-06-21T16:11:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=44f9a3566ce564f9a21b1b92940a520ea241e065'/>
<id>44f9a3566ce564f9a21b1b92940a520ea241e065</id>
<content type='text'>
The issue go#46783 correctly diagnosed the context timeout
caused an intermittent failure when the context was canceled
prior to the BeginTx call. However due to the asynchronous nature
of canceling a Tx through a context on fast systems, the tx.Prepare
also succeeded. On slower systems or if a time.Sleep was inserted
between the BeginTx and Prepare, the Prepare would fail.

Resolve this by moving the context cancel after the Prepare.
This will still trigger the deadlock which I tested locally.
In addition, I interspersed multiple time.Sleep calls and the
test still functioned.

Fixes #46852

Change-Id: I9cbf90d3c12b2555493a37799738772b615ae39d
Reviewed-on: https://go-review.googlesource.com/c/go/+/329830
Run-TryBot: Daniel Theophanes &lt;kardianos@gmail.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Trust: Bryan C. Mills &lt;bcmills@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The issue go#46783 correctly diagnosed the context timeout
caused an intermittent failure when the context was canceled
prior to the BeginTx call. However due to the asynchronous nature
of canceling a Tx through a context on fast systems, the tx.Prepare
also succeeded. On slower systems or if a time.Sleep was inserted
between the BeginTx and Prepare, the Prepare would fail.

Resolve this by moving the context cancel after the Prepare.
This will still trigger the deadlock which I tested locally.
In addition, I interspersed multiple time.Sleep calls and the
test still functioned.

Fixes #46852

Change-Id: I9cbf90d3c12b2555493a37799738772b615ae39d
Reviewed-on: https://go-review.googlesource.com/c/go/+/329830
Run-TryBot: Daniel Theophanes &lt;kardianos@gmail.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Trust: Bryan C. Mills &lt;bcmills@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>database/sql: do not rely on timeout for deadlock test</title>
<updated>2021-06-19T00:46:21+00:00</updated>
<author>
<name>Daniel Theophanes</name>
<email>kardianos@gmail.com</email>
</author>
<published>2021-06-16T16:46:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=b73cc4b02b3801603b3ce0bcc57cf01d6aa9a4dd'/>
<id>b73cc4b02b3801603b3ce0bcc57cf01d6aa9a4dd</id>
<content type='text'>
Fixes #46783

Change-Id: I8a8d1716279a041a7411c0c47a440a7997b39c80
Reviewed-on: https://go-review.googlesource.com/c/go/+/328649
Run-TryBot: Daniel Theophanes &lt;kardianos@gmail.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Bryan C. Mills &lt;bcmills@google.com&gt;
Trust: Carlos Amedee &lt;carlos@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #46783

Change-Id: I8a8d1716279a041a7411c0c47a440a7997b39c80
Reviewed-on: https://go-review.googlesource.com/c/go/+/328649
Run-TryBot: Daniel Theophanes &lt;kardianos@gmail.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Bryan C. Mills &lt;bcmills@google.com&gt;
Trust: Carlos Amedee &lt;carlos@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>database/sql: add NullInt16 and NullByte</title>
<updated>2021-05-04T17:31:29+00:00</updated>
<author>
<name>Ariel Mashraki</name>
<email>ariel@mashraki.co.il</email>
</author>
<published>2021-04-20T13:15:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=10d625d5b41f17c118da18a592c683e60fcdcb3b'/>
<id>10d625d5b41f17c118da18a592c683e60fcdcb3b</id>
<content type='text'>
Fixes #40082

Change-Id: I01cd4d0e23c0376a6ee6e0b196c9f840cd662325
Reviewed-on: https://go-review.googlesource.com/c/go/+/311572
Reviewed-by: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
Reviewed-by: Daniel Theophanes &lt;kardianos@gmail.com&gt;
Run-TryBot: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #40082

Change-Id: I01cd4d0e23c0376a6ee6e0b196c9f840cd662325
Reviewed-on: https://go-review.googlesource.com/c/go/+/311572
Reviewed-by: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
Reviewed-by: Daniel Theophanes &lt;kardianos@gmail.com&gt;
Run-TryBot: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>all: fix spellings</title>
<updated>2021-04-10T01:46:41+00:00</updated>
<author>
<name>Naman Gera</name>
<email>namangera15@gmail.com</email>
</author>
<published>2021-04-09T03:48:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=52bf14e0e8bdcd73f1ddfb0c4a1d0200097d3ba2'/>
<id>52bf14e0e8bdcd73f1ddfb0c4a1d0200097d3ba2</id>
<content type='text'>
This follows the spelling choices that the Go project has made for English words.
https://github.com/golang/go/wiki/Spelling

Change-Id: Ie7c586d2cf23020cb492cfff58c0831d2d8d3a78
GitHub-Last-Rev: e16a32cd225a275f73d236bcb33703986d110ded
GitHub-Pull-Request: golang/go#45442
Reviewed-on: https://go-review.googlesource.com/c/go/+/308291
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Trust: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This follows the spelling choices that the Go project has made for English words.
https://github.com/golang/go/wiki/Spelling

Change-Id: Ie7c586d2cf23020cb492cfff58c0831d2d8d3a78
GitHub-Last-Rev: e16a32cd225a275f73d236bcb33703986d110ded
GitHub-Pull-Request: golang/go#45442
Reviewed-on: https://go-review.googlesource.com/c/go/+/308291
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Trust: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>database/sql: remove unnecessary types in composite literals</title>
<updated>2021-03-25T14:46:50+00:00</updated>
<author>
<name>Elias506</name>
<email>56119080+Elias506@users.noreply.github.com</email>
</author>
<published>2021-03-25T14:46:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=4d66d77cd22812de4526e3973bc3314040a939a5'/>
<id>4d66d77cd22812de4526e3973bc3314040a939a5</id>
<content type='text'>
Change-Id: I30c576f826c82cbc62ce28ea7f4886702bd6605d
GitHub-Last-Rev: 2fead200dba13ec74d81e842d8bae97d1e67fcc4
GitHub-Pull-Request: golang/go#42618
Reviewed-on: https://go-review.googlesource.com/c/go/+/270000
Reviewed-by: Daniel Theophanes &lt;kardianos@gmail.com&gt;
Trust: Cherry Zhang &lt;cherryyz@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I30c576f826c82cbc62ce28ea7f4886702bd6605d
GitHub-Last-Rev: 2fead200dba13ec74d81e842d8bae97d1e67fcc4
GitHub-Pull-Request: golang/go#42618
Reviewed-on: https://go-review.googlesource.com/c/go/+/270000
Reviewed-by: Daniel Theophanes &lt;kardianos@gmail.com&gt;
Trust: Cherry Zhang &lt;cherryyz@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>docs: clarify when APIs use context.Background.</title>
<updated>2021-03-11T16:37:38+00:00</updated>
<author>
<name>Matt T. Proud</name>
<email>matt.proud@gmail.com</email>
</author>
<published>2021-02-25T00:03:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=0fc370c5d26353a865a29a01f093942c949d530a'/>
<id>0fc370c5d26353a865a29a01f093942c949d530a</id>
<content type='text'>
The Go standard library retrofitted context support onto existing APIs
using context.Background and later offered variants that directly
supported user-defined context value specification. This commit makes
that behavior clear in documentation and suggests context-aware
alternatives if the user is looking for one.

An example motivation is supporting code for use in systems that expect
APIs to be cancelable for lifecycle correctness or load
shedding/management reasons, as alluded to in
https://blog.golang.org/context-and-structs.

Updates #44143

Change-Id: I2d7f954ddf9b48264d5ebc8d0007058ff9bddf14
Reviewed-on: https://go-review.googlesource.com/c/go/+/296152
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: Jean de Klerk &lt;deklerk@google.com&gt;
Trust: Jean de Klerk &lt;deklerk@google.com&gt;
Run-TryBot: Jean de Klerk &lt;deklerk@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Go standard library retrofitted context support onto existing APIs
using context.Background and later offered variants that directly
supported user-defined context value specification. This commit makes
that behavior clear in documentation and suggests context-aware
alternatives if the user is looking for one.

An example motivation is supporting code for use in systems that expect
APIs to be cancelable for lifecycle correctness or load
shedding/management reasons, as alluded to in
https://blog.golang.org/context-and-structs.

Updates #44143

Change-Id: I2d7f954ddf9b48264d5ebc8d0007058ff9bddf14
Reviewed-on: https://go-review.googlesource.com/c/go/+/296152
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: Jean de Klerk &lt;deklerk@google.com&gt;
Trust: Jean de Klerk &lt;deklerk@google.com&gt;
Run-TryBot: Jean de Klerk &lt;deklerk@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>database/sql: close driver.Connector if it implements io.Closer</title>
<updated>2021-02-25T19:34:27+00:00</updated>
<author>
<name>Ivan Trubach</name>
<email>mr.trubach@icloud.com</email>
</author>
<published>2021-02-25T19:15:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=194b636f8f1ff7d6b709b5b9010d1d14b3919e66'/>
<id>194b636f8f1ff7d6b709b5b9010d1d14b3919e66</id>
<content type='text'>
This change allows driver implementations to manage resources in
driver.Connector, e.g. to share the same underlying database handle
between multiple connections. That is, it allows embedded databases
with in-memory backends like SQLite and Genji to safely release the
resources once the sql.DB is closed.

This makes it possible to address oddities with in-memory stores in
SQLite and Genji drivers without introducing too much complexity in
the driver implementations.

See also:
- https://github.com/mattn/go-sqlite3/issues/204
- https://github.com/mattn/go-sqlite3/issues/511
- https://github.com/genjidb/genji/issues/210

Fixes #41790

Change-Id: Idbd19763134438ed38288b9d44f16608e4e97fd7
GitHub-Last-Rev: 962c785dfb3bb6ad98b2216bcedd84ba383fe872
GitHub-Pull-Request: golang/go#41710
Reviewed-on: https://go-review.googlesource.com/c/go/+/258360
Reviewed-by: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
Reviewed-by: Daniel Theophanes &lt;kardianos@gmail.com&gt;
Trust: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
Run-TryBot: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change allows driver implementations to manage resources in
driver.Connector, e.g. to share the same underlying database handle
between multiple connections. That is, it allows embedded databases
with in-memory backends like SQLite and Genji to safely release the
resources once the sql.DB is closed.

This makes it possible to address oddities with in-memory stores in
SQLite and Genji drivers without introducing too much complexity in
the driver implementations.

See also:
- https://github.com/mattn/go-sqlite3/issues/204
- https://github.com/mattn/go-sqlite3/issues/511
- https://github.com/genjidb/genji/issues/210

Fixes #41790

Change-Id: Idbd19763134438ed38288b9d44f16608e4e97fd7
GitHub-Last-Rev: 962c785dfb3bb6ad98b2216bcedd84ba383fe872
GitHub-Pull-Request: golang/go#41710
Reviewed-on: https://go-review.googlesource.com/c/go/+/258360
Reviewed-by: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
Reviewed-by: Daniel Theophanes &lt;kardianos@gmail.com&gt;
Trust: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
Run-TryBot: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>database: remove race in TestTxContextWait</title>
<updated>2021-02-24T14:10:04+00:00</updated>
<author>
<name>Josh Bleecher Snyder</name>
<email>josharian@gmail.com</email>
</author>
<published>2021-02-01T16:35:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=e49612089196be102b4b7f86c417b8cfba2521aa'/>
<id>e49612089196be102b4b7f86c417b8cfba2521aa</id>
<content type='text'>
This test contained a data race.
On line 437, db.BeginTx starts a goroutine that runs tx.awaitDone,
which reads tx.keepConnOnRollback.
On line 445, the test writes to tx.keepConnOnRollback.
tx.awaitDone waits on ctx, but because ctx is timeout-based,
there's no ordering guarantee between the write and the read.

The race detector never caught this before
because the context package implementation of Done
contained enough synchronization to make it safe.
That synchronization is not package of the context API or guarantees,
and the first several releases it was not present.
Another commit soon will remove that synchronization,
exposing the latent data race.

To fix the race, emulate a time-based context
using an explicit cancellation-based context.
This gives us enough control to avoid the race.

Change-Id: I103fe9b987b1d4c02e7a20ac3c22a682652128b6
Reviewed-on: https://go-review.googlesource.com/c/go/+/288493
Trust: Josh Bleecher Snyder &lt;josharian@gmail.com&gt;
Run-TryBot: Josh Bleecher Snyder &lt;josharian@gmail.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Daniel Theophanes &lt;kardianos@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This test contained a data race.
On line 437, db.BeginTx starts a goroutine that runs tx.awaitDone,
which reads tx.keepConnOnRollback.
On line 445, the test writes to tx.keepConnOnRollback.
tx.awaitDone waits on ctx, but because ctx is timeout-based,
there's no ordering guarantee between the write and the read.

The race detector never caught this before
because the context package implementation of Done
contained enough synchronization to make it safe.
That synchronization is not package of the context API or guarantees,
and the first several releases it was not present.
Another commit soon will remove that synchronization,
exposing the latent data race.

To fix the race, emulate a time-based context
using an explicit cancellation-based context.
This gives us enough control to avoid the race.

Change-Id: I103fe9b987b1d4c02e7a20ac3c22a682652128b6
Reviewed-on: https://go-review.googlesource.com/c/go/+/288493
Trust: Josh Bleecher Snyder &lt;josharian@gmail.com&gt;
Run-TryBot: Josh Bleecher Snyder &lt;josharian@gmail.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Daniel Theophanes &lt;kardianos@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>database/sql: fix typo in comment</title>
<updated>2020-12-10T18:23:15+00:00</updated>
<author>
<name>Hein Khant Zaw</name>
<email>heinkhantzaw1@gmail.com</email>
</author>
<published>2020-12-10T16:45:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=422dc83baa2816ca1d9a0aa3f1aaf4c47c8098ad'/>
<id>422dc83baa2816ca1d9a0aa3f1aaf4c47c8098ad</id>
<content type='text'>
Fixes #43116

Change-Id: Ib04fab6ae03f322aa1508ec00523f628d891247a
GitHub-Last-Rev: 0a86e665b2c320e0b2aef75ee53bd7281b19b013
GitHub-Pull-Request: golang/go#43122
Reviewed-on: https://go-review.googlesource.com/c/go/+/276992
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: Daniel Theophanes &lt;kardianos@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #43116

Change-Id: Ib04fab6ae03f322aa1508ec00523f628d891247a
GitHub-Last-Rev: 0a86e665b2c320e0b2aef75ee53bd7281b19b013
GitHub-Pull-Request: golang/go#43122
Reviewed-on: https://go-review.googlesource.com/c/go/+/276992
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: Daniel Theophanes &lt;kardianos@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>database/sql, runtime: correct *.Fatal inside goroutines in tests</title>
<updated>2020-10-31T20:30:19+00:00</updated>
<author>
<name>Emmanuel T Odeke</name>
<email>emmanuel@orijtech.com</email>
</author>
<published>2020-05-30T00:19:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=715d4e2e014fa54f527ee109f26a31f941196381'/>
<id>715d4e2e014fa54f527ee109f26a31f941196381</id>
<content type='text'>
Found by go vet pass "testinggoroutines".

Change-Id: I6360af2079617b7aa62dcb9bd7254578ca5d1c1d
Reviewed-on: https://go-review.googlesource.com/c/go/+/235527
Run-TryBot: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Trust: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Found by go vet pass "testinggoroutines".

Change-Id: I6360af2079617b7aa62dcb9bd7254578ca5d1c1d
Reviewed-on: https://go-review.googlesource.com/c/go/+/235527
Run-TryBot: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Trust: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
