[go] sync/map: clear

77 views
Skip to first unread message

Gerrit Bot (Gerrit)

unread,
Aug 1, 2023, 4:29:02 PM8/1/23
to goph...@pubsubhelper.golang.org, Hiro Hamada, golang-co...@googlegroups.com

Gerrit Bot has uploaded this change for review.

View Change

sync/map: clear

For #61696

Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
GitHub-Last-Rev: 5b099eea95fa759a9d3468d4e7bec19aba0bc6ce
GitHub-Pull-Request: golang/go#61702
---
M src/sync/map.go
M src/sync/map_test.go
2 files changed, 83 insertions(+), 0 deletions(-)

diff --git a/src/sync/map.go b/src/sync/map.go
index e8ccf58..eb93a1f 100644
--- a/src/sync/map.go
+++ b/src/sync/map.go
@@ -155,6 +155,18 @@
_, _ = m.Swap(key, value)
}

+func (m *Map) Clear() {
+ defer m.mu.Unlock()
+ m.mu.Lock()
+
+ read := m.loadReadOnly()
+
+ clear(read.m) // FIXME: e.delete()
+
+ clear(m.dirty)
+
+}
+
// tryCompareAndSwap compare the entry with the given old value and swaps
// it with a new value if the entry is equal to the old value, and the entry
// has not been expunged.
diff --git a/src/sync/map_test.go b/src/sync/map_test.go
index 1eb3fc6..cde91e3 100644
--- a/src/sync/map_test.go
+++ b/src/sync/map_test.go
@@ -280,3 +280,74 @@
t.Fatalf("CompareAndSwap on an non-existing key succeeded")
}
}
+
+func TestMapClear(t *testing.T) {
+
+ var myMap sync.Map
+
+ key := "go"
+ val := 1.21
+ myMap.Store(key, val)
+ loadedVal, ok := myMap.Load(key)
+
+ if !ok {
+ t.Fatalf("Store failed to store- %v:%v", key, val)
+ }
+
+ if loadedVal != val {
+ t.Fatalf("Load: invalid value- %v:%v", key, loadedVal)
+ }
+
+ myMap.Clear()
+
+ nilVal, ok := myMap.Load(key)
+
+ if nilVal != nil {
+ t.Fatalf("Clear: failed %v:%v", key, nilVal)
+ }
+
+ if !ok {
+ t.Fatalf("Clear: failed %v:%v", key, nilVal)
+ }
+}
+
+func TestMapClearRace(t *testing.T) {
+ var myMap sync.Map
+
+ wg := sync.WaitGroup{}
+ wg.Add(30) // 10 goroutines for writing, 10 goroutines for reading, 10 goroutines for waiting
+
+ // Writing data to the map concurrently
+ for i := 0; i < 10; i++ {
+ go func(key, value int) {
+ defer wg.Done()
+ myMap.Store(key, value)
+ }(i, i*10)
+ }
+
+ // Reading data from the map concurrently
+ for i := 0; i < 10; i++ {
+ go func(key int) {
+ defer wg.Done()
+ if value, ok := myMap.Load(key); ok {
+ t.Logf("Key: %v, Value: %v\n", key, value)
+ } else {
+ t.Logf("Key: %v not found\n", key)
+ }
+ }(i)
+ }
+
+ // Clearing data from the map concurrently
+ for i := 0; i < 10; i++ {
+ go func() {
+ defer wg.Done()
+ // myMap.Clear()
+ }()
+ }
+ myMap.Clear()
+
+ wg.Wait()
+
+ myMap.Clear()
+
+}

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 1
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>

Gerrit Bot (Gerrit)

unread,
Aug 1, 2023, 4:41:08 PM8/1/23
to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Russ Cox.

Gerrit Bot uploaded patch set #2 to this change.

View Change

sync/map: clear

For #61696

Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
GitHub-Last-Rev: afc46339743decf58d5ac51d868eb0ee26884a75

GitHub-Pull-Request: golang/go#61702
---
M src/sync/map.go
M src/sync/map_test.go
2 files changed, 117 insertions(+), 0 deletions(-)

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 2
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>

Hiro Hamada (Gerrit)

unread,
Aug 1, 2023, 4:44:44 PM8/1/23
to Gerrit Bot, goph...@pubsubhelper.golang.org, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Russ Cox.

View Change

1 comment:

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 2
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Comment-Date: Tue, 01 Aug 2023 20:44:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Russ Cox <r...@golang.org>

Gerrit Bot (Gerrit)

unread,
Aug 1, 2023, 4:47:29 PM8/1/23
to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Russ Cox.

Gerrit Bot uploaded patch set #3 to this change.

View Change

sync/map: clear

For #61696

Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
GitHub-Last-Rev: f268be33d5fe309a435c338a84f4eb65e2d9a633

GitHub-Pull-Request: golang/go#61702
---
M src/sync/map.go
M src/sync/map_test.go
2 files changed, 123 insertions(+), 0 deletions(-)

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 3

Hiro Hamada (Gerrit)

unread,
Aug 1, 2023, 4:47:30 PM8/1/23
to Gerrit Bot, goph...@pubsubhelper.golang.org, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Russ Cox.

View Change

1 comment:

  • Patchset:

    • Patch Set #2:

      I came across a failing test. Want to realize if its a bug

      func TestMapDelete(t *testing.T) {

      	var myMap sync.Map
      	key := "go"
      val := 1.21
      myMap.Store(key, val)
      loadedVal, ok := myMap.Load(key)
      	if !ok {

    • t.Fatalf("Store failed to store- %v:%v", key, val)
      }
    • 	if loadedVal != val {

    • t.Fatalf("Load: invalid value- %v:%v", key, loadedVal)
      }
    • 	myMap.Delete(key)
      	nilVal, ok := myMap.Load(key)
      	if nilVal != nil {
      t.Fatalf("Delete: failed %v:%v", key, nilVal)
      }
      	if !ok { // FIXME: failing test
      t.Fatalf("Delete: failed found val %v:%v", key, nilVal)
      }
      }

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 2
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Comment-Date: Tue, 01 Aug 2023 20:45:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Gerrit Bot (Gerrit)

unread,
Aug 1, 2023, 4:53:35 PM8/1/23
to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Russ Cox.

Gerrit Bot uploaded patch set #4 to this change.

View Change

sync/map: clear

For #61696

Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
GitHub-Last-Rev: e68759e896c56a155b5cde08fe591d487a5f460d

GitHub-Pull-Request: golang/go#61702
---
M src/sync/map.go
M src/sync/map_test.go
2 files changed, 127 insertions(+), 0 deletions(-)

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 4

Gerrit Bot (Gerrit)

unread,
Aug 1, 2023, 4:59:46 PM8/1/23
to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Russ Cox.

Gerrit Bot uploaded patch set #5 to this change.

View Change

sync/map: clear

For #61696

Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
GitHub-Last-Rev: 632ea9f865daa74446b13004ce4133edbdeee6f5

GitHub-Pull-Request: golang/go#61702
---
M src/sync/map.go
M src/sync/map_test.go
2 files changed, 119 insertions(+), 0 deletions(-)

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 5

Hiro Hamada (Gerrit)

unread,
Aug 1, 2023, 5:02:50 PM8/1/23
to Gerrit Bot, goph...@pubsubhelper.golang.org, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Russ Cox.

View Change

1 comment:

  • File src/sync/map.go:

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 4
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Comment-Date: Tue, 01 Aug 2023 21:02:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Russ Cox <r...@golang.org>

Hiro Hamada (Gerrit)

unread,
Aug 1, 2023, 5:04:16 PM8/1/23
to Gerrit Bot, goph...@pubsubhelper.golang.org, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Russ Cox.

View Change

1 comment:

    • myMap.Delete(key)

      nilVal, ok := myMap.Load(key)

    • if !ok { // FIXME: failing test

    • t.Fatalf("Delete: failed found val %v:%v", key, nilVal)
      }

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 5
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Comment-Date: Tue, 01 Aug 2023 21:04:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Gerrit Bot (Gerrit)

unread,
Aug 1, 2023, 5:06:19 PM8/1/23
to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Russ Cox.

Gerrit Bot uploaded patch set #6 to this change.

View Change

sync/map: clear

For #61696

Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
GitHub-Last-Rev: dcb07ff29030f7b69f0a8e5a51ba22b62f60f5cc

GitHub-Pull-Request: golang/go#61702
---
M src/sync/map.go
M src/sync/map_test.go
2 files changed, 125 insertions(+), 0 deletions(-)

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 6

Hiro Hamada (Gerrit)

unread,
Aug 1, 2023, 5:06:30 PM8/1/23
to Gerrit Bot, goph...@pubsubhelper.golang.org, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Russ Cox.

View Change

1 comment:

  • Patchset:

    • Patch Set #5:

      myMap.Delete(key) […]

      Never mind I made a typo !ok should have ok

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 5
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Comment-Date: Tue, 01 Aug 2023 21:06:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Hiro Hamada <laci...@gmail.com>

Hiro Hamada (Gerrit)

unread,
Aug 1, 2023, 5:09:17 PM8/1/23
to Gerrit Bot, goph...@pubsubhelper.golang.org, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Russ Cox.

View Change

1 comment:

  • Patchset:

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 6
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Comment-Date: Tue, 01 Aug 2023 21:09:10 +0000

Gerrit Bot (Gerrit)

unread,
Aug 1, 2023, 5:12:18 PM8/1/23
to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Russ Cox.

Gerrit Bot uploaded patch set #7 to this change.

View Change

sync/map: Clear

For #61696

Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
GitHub-Last-Rev: 277176f6dbe77186f4aacba70bb99b9f25747658

GitHub-Pull-Request: golang/go#61702
---
M src/sync/map.go
M src/sync/map_test.go
2 files changed, 122 insertions(+), 0 deletions(-)

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 7

qiulaidongfeng (Gerrit)

unread,
Sep 7, 2023, 9:22:13 AM9/7/23
to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Russ Cox.

View Change

4 comments:

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 7
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>
Gerrit-CC: qiulaidongfeng <26454...@qq.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Comment-Date: Thu, 07 Sep 2023 13:22:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

qiulaidongfeng (Gerrit)

unread,
Sep 7, 2023, 9:23:10 AM9/7/23
to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Russ Cox.

View Change

1 comment:

  • Patchset:

    • Patch Set #7:

      There is a merge conflict, please run git codereview sync.

    • I pressed the wrong button, it didn't solve it.

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 7
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>
Gerrit-CC: qiulaidongfeng <26454...@qq.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Comment-Date: Thu, 07 Sep 2023 13:23:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: qiulaidongfeng <26454...@qq.com>

Hiro Hamada (Gerrit)

unread,
Sep 7, 2023, 1:01:59 PM9/7/23
to Gerrit Bot, goph...@pubsubhelper.golang.org, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Russ Cox, qiulaidongfeng.

View Change

1 comment:

  • Patchset:

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 7
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>
Gerrit-CC: qiulaidongfeng <26454...@qq.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
Gerrit-Comment-Date: Thu, 07 Sep 2023 17:01:49 +0000

Hiro Hamada (Gerrit)

unread,
Sep 7, 2023, 1:51:22 PM9/7/23
to Gerrit Bot, goph...@pubsubhelper.golang.org, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Russ Cox, qiulaidongfeng.

View Change

1 comment:

  • Patchset:

    • Patch Set #7:

      done resolved. Will take some time for gopher bot to sync

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 7
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>
Gerrit-CC: qiulaidongfeng <26454...@qq.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
Gerrit-Comment-Date: Thu, 07 Sep 2023 17:51:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Hiro Hamada (Gerrit)

unread,
Sep 7, 2023, 2:00:55 PM9/7/23
to Gerrit Bot, goph...@pubsubhelper.golang.org, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Russ Cox, qiulaidongfeng.

View Change

2 comments:

  • File src/sync/map_test.go:

    • yeah i think delete is unnecessary

    • Patch Set #7, Line 341:

      	myMap.Store(key, val)

      if val1, ok := myMap.Load(key); !ok || val1 != val {
      t.Fatalf("Store: failed after clear %v:%v", key, val1)
      }

      Why re store the cleared data?

    • Store: failed after clear. Test

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 7
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>
Gerrit-CC: qiulaidongfeng <26454...@qq.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
Gerrit-Comment-Date: Thu, 07 Sep 2023 18:00:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: qiulaidongfeng <26454...@qq.com>

Gerrit Bot (Gerrit)

unread,
Sep 7, 2023, 2:01:32 PM9/7/23
to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Russ Cox, qiulaidongfeng.

Gerrit Bot uploaded patch set #8 to this change.

View Change

sync/map: Clear

For #61696

Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
GitHub-Last-Rev: 9c11c75aca0e5f8d035da159d75dc44ba4ae970c

GitHub-Pull-Request: golang/go#61702
---
M src/sync/map.go
M src/sync/map_test.go
2 files changed, 120 insertions(+), 0 deletions(-)

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 8

Ian Lance Taylor (Gerrit)

unread,
Sep 7, 2023, 2:46:14 PM9/7/23
to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Ian Lance Taylor, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Russ Cox, qiulaidongfeng.

View Change

5 comments:

  • Patchset:

    • Patch Set #8:

      You'll need to add an entry in $GOROOT/api/next for the new method. Follow the existing format in that file. Test it by running "go tool dist test -run=api".

  • Commit Message:

  • File src/sync/map.go:

  • File src/sync/map_test.go:

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 8
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>
Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
Gerrit-CC: qiulaidongfeng <26454...@qq.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
Gerrit-Comment-Date: Thu, 07 Sep 2023 18:46:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Hiro Hamada (Gerrit)

unread,
Sep 7, 2023, 4:01:33 PM9/7/23
to Gerrit Bot, goph...@pubsubhelper.golang.org, Ian Lance Taylor, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

View Change

4 comments:

  • Commit Message:

    • sync: add Map. […]

      done

  • File src/sync/map.go:

    • done

    • done

  • File src/sync/map_test.go:

    • Done

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 8
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>
Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
Gerrit-CC: qiulaidongfeng <26454...@qq.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
Gerrit-Comment-Date: Thu, 07 Sep 2023 20:01:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ian Lance Taylor <ia...@golang.org>

Gerrit Bot (Gerrit)

unread,
Sep 7, 2023, 4:04:39 PM9/7/23
to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

Gerrit Bot uploaded patch set #9 to this change.

View Change

sync: add Map.Clear

For #61696

Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
GitHub-Last-Rev: 643c116b2e8b3a6ae8addee674ffbcbb983f44fe

GitHub-Pull-Request: golang/go#61702
---
M src/sync/map.go
M src/sync/map_test.go
2 files changed, 119 insertions(+), 0 deletions(-)

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 9

Hiro Hamada (Gerrit)

unread,
Sep 7, 2023, 4:10:25 PM9/7/23
to Gerrit Bot, goph...@pubsubhelper.golang.org, Bryan Mills, Ian Lance Taylor, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Russ Cox, qiulaidongfeng.

View Change

1 comment:

  • Patchset:

    • Patch Set #8:

      You'll need to add an entry in $GOROOT/api/next for the new method. […]

      I am getting:

      ```


    • go tool dist test -run=api

    • warning: GOPATH set to GOROOT (/Users/hiro/goferHiro/go) has no effect
      warning: GOPATH set to GOROOT (/Users/hiro/goferHiro/go) has no effect
      warning: GOPATH set to GOROOT (/Users/hiro/goferHiro/go) has no effect
      warning: GOPATH set to GOROOT (/Users/hiro/goferHiro/go) has no effect

      ##### Test execution environment.
      warning: GOPATH set to GOROOT (/Users/hiro/goferHiro/go) has no effect
      # GOARCH: arm64
      # CPU:
      # GOOS: darwin
      # OS Version: Darwin 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:39:35 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T8103 arm64

      ##### Testing packages.
      warning: GOPATH set to GOROOT (/Users/hiro/goferHiro/go) has no effect
      2023/09/08 01:39:22 go list: invalid output: invalid character 'w' looking for beginning of value
      FAIL cmd/api 0.683s
      FAIL
      go tool dist: Failed: exit status 1

      ```

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 9
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>
Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
Gerrit-CC: qiulaidongfeng <26454...@qq.com>
Gerrit-Attention: Bryan Mills <bcm...@google.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
Gerrit-Comment-Date: Thu, 07 Sep 2023 20:10:17 +0000

Gerrit Bot (Gerrit)

unread,
Sep 7, 2023, 4:10:54 PM9/7/23
to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Russ Cox, qiulaidongfeng.

Gerrit Bot uploaded patch set #10 to this change.

View Change

sync: add Map.Clear

For #61696

Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
GitHub-Last-Rev: 474255c26c7bd9735dcb1214ea44975ee5be833f
GitHub-Pull-Request: golang/go#61702
---
A api/next/61696.txt
M src/sync/map.go
M src/sync/map_test.go
3 files changed, 120 insertions(+), 0 deletions(-)

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 10

Hiro Hamada (Gerrit)

unread,
Sep 7, 2023, 4:13:04 PM9/7/23
to Gerrit Bot, goph...@pubsubhelper.golang.org, Bryan Mills, Ian Lance Taylor, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

View Change

1 comment:

  • Patchset:

    • Patch Set #8:

      I am getting: […]

      do i need to add in src/cmd/api/testdata?

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 9
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>
Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
Gerrit-CC: qiulaidongfeng <26454...@qq.com>
Gerrit-Attention: Bryan Mills <bcm...@google.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
Gerrit-Comment-Date: Thu, 07 Sep 2023 20:12:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Hiro Hamada <laci...@gmail.com>

Ian Lance Taylor (Gerrit)

unread,
Sep 7, 2023, 4:24:59 PM9/7/23
to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Bryan Mills, Ian Lance Taylor, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Hiro Hamada, Russ Cox, qiulaidongfeng.

View Change

1 comment:

  • Patchset:

    • Patch Set #8:

      do i need to add in src/cmd/api/testdata?

      You shouldn't need to change anything in cmd/api/testdata. I don't know what that "go list" error means. To avoid the GOPATH errors set the environment variable GOPATH to some other directory. The default for GOPATH is $HOME/go, but you are using that for GOROOT.

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 10
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>
Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
Gerrit-CC: qiulaidongfeng <26454...@qq.com>
Gerrit-Attention: Hiro Hamada <laci...@gmail.com>
Gerrit-Attention: Bryan Mills <bcm...@google.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
Gerrit-Comment-Date: Thu, 07 Sep 2023 20:24:53 +0000

Bryan Mills (Gerrit)

unread,
Sep 7, 2023, 4:40:17 PM9/7/23
to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Bryan Mills, Ian Lance Taylor, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Dmitry Vyukov, Hiro Hamada, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

View Change

1 comment:

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 10
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>
Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
Gerrit-CC: qiulaidongfeng <26454...@qq.com>
Gerrit-Attention: Hiro Hamada <laci...@gmail.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
Gerrit-Comment-Date: Thu, 07 Sep 2023 20:40:12 +0000

Ian Lance Taylor (Gerrit)

unread,
Sep 7, 2023, 4:59:58 PM9/7/23
to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Bryan Mills, Ian Lance Taylor, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Hiro Hamada, Russ Cox, qiulaidongfeng.

View Change

1 comment:

  • Patchset:

    • Patch Set #8:

      The error is from `cmd/api/main_test. […]

      Thanks, CL 526775.

To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
Gerrit-Change-Number: 515015
Gerrit-PatchSet: 10
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Hiro Hamada <laci...@gmail.com>
Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
Gerrit-CC: qiulaidongfeng <26454...@qq.com>
Gerrit-Attention: Bryan Mills <bcm...@google.com>
Gerrit-Attention: Hiro Hamada <laci...@gmail.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
Gerrit-Comment-Date: Thu, 07 Sep 2023 20:59:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Bryan Mills <bcm...@google.com>

Ian Lance Taylor (Gerrit)

unread,
Sep 7, 2023, 5:00:19 PM9/7/23
to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Hiro Hamada, Russ Cox, qiulaidongfeng.

Patch set 10:Commit-Queue +1

View Change

    To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
    Gerrit-Change-Number: 515015
    Gerrit-PatchSet: 10
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Austin Clements <aus...@google.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Reviewer: Russ Cox <r...@golang.org>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Hiro Hamada <laci...@gmail.com>
    Gerrit-CC: qiulaidongfeng <26454...@qq.com>
    Gerrit-Attention: Bryan Mills <bcm...@google.com>
    Gerrit-Attention: Hiro Hamada <laci...@gmail.com>
    Gerrit-Attention: Austin Clements <aus...@google.com>
    Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
    Gerrit-Attention: Russ Cox <r...@golang.org>
    Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
    Gerrit-Comment-Date: Thu, 07 Sep 2023 21:00:12 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes

    Hiro Hamada (Gerrit)

    unread,
    Sep 7, 2023, 5:17:14 PM9/7/23
    to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

    Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

    View Change

    1 comment:

    • Patchset:

      • Patch Set #8:

        Thanks, CL 526775.

        Thanks Ian Lance Taylor: when I updated GOPATH. the problem was resolved

      • ```
        go tool dist test -run=api
      • ##### Test execution environment.


      • # GOARCH: arm64
        # CPU:
        # GOOS: darwin
        # OS Version: Darwin 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:39:35 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T8103 arm64

      • ##### Testing packages.
        ok cmd/api 0.696s

        ##### API check
        ok cmd/api 10.278s

        ALL TESTS PASSED (some were excluded)

        ```

    To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
    Gerrit-Change-Number: 515015
    Gerrit-PatchSet: 10
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Austin Clements <aus...@google.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Reviewer: Russ Cox <r...@golang.org>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Hiro Hamada <laci...@gmail.com>
    Gerrit-CC: qiulaidongfeng <26454...@qq.com>
    Gerrit-Attention: Bryan Mills <bcm...@google.com>
    Gerrit-Attention: Austin Clements <aus...@google.com>
    Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Russ Cox <r...@golang.org>
    Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
    Gerrit-Comment-Date: Thu, 07 Sep 2023 21:17:07 +0000

    Gerrit Bot (Gerrit)

    unread,
    Sep 7, 2023, 5:21:11 PM9/7/23
    to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

    Gerrit Bot uploaded patch set #11 to this change.

    View Change

    The following approvals got outdated and were removed: LUCI-TryBot-Result-1 by Go LUCI

    sync: add Map.Clear

    For #61696

    Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
    GitHub-Last-Rev: 6e06a5475ca2e5a33aab8161e8b1cc116f5a1ebf

    GitHub-Pull-Request: golang/go#61702
    ---
    A api/next/61696.txt
    M src/sync/map.go
    M src/sync/map_test.go
    3 files changed, 120 insertions(+), 0 deletions(-)

    To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: newpatchset
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
    Gerrit-Change-Number: 515015
    Gerrit-PatchSet: 11

    Ian Lance Taylor (Gerrit)

    unread,
    Sep 7, 2023, 7:38:29 PM9/7/23
    to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Ian Lance Taylor, Go LUCI, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

    Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Russ Cox, qiulaidongfeng.

    Patch set 11:Commit-Queue +1

    View Change

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 11
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Thu, 07 Sep 2023 23:38:22 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes

      qiulaidongfeng (Gerrit)

      unread,
      Sep 7, 2023, 8:10:15 PM9/7/23
      to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

      View Change

      1 comment:

        • 	myMap.Store(key, val)

          if val1, ok := myMap.Load(key); !ok || val1 != val {
          t.Fatalf("Store: failed after clear %v:%v", key, val1)
          }

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 11
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Fri, 08 Sep 2023 00:10:08 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      qiulaidongfeng (Gerrit)

      unread,
      Sep 7, 2023, 8:10:42 PM9/7/23
      to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Hiro Hamada, Ian Lance Taylor, Russ Cox.

      View Change

      1 comment:

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 11
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Hiro Hamada <laci...@gmail.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Fri, 08 Sep 2023 00:10:37 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Hiro Hamada <laci...@gmail.com>
      Comment-In-Reply-To: qiulaidongfeng <26454...@qq.com>

      Hiro Hamada (Gerrit)

      unread,
      Sep 7, 2023, 8:42:45 PM9/7/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      1 comment:

      • File src/sync/map_test.go:

        • Patch Set #11, Line 352:

          	myMap.Store(key, val)

          if val1, ok := myMap.Load(key); !ok || val1 != val {
          t.Fatalf("Store: failed after clear %v:%v", key, val1)
          }

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 11
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Fri, 08 Sep 2023 00:42:38 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: qiulaidongfeng <26454...@qq.com>

      qiulaidongfeng (Gerrit)

      unread,
      Sep 7, 2023, 8:48:34 PM9/7/23
      to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Hiro Hamada, Ian Lance Taylor, Russ Cox.

      View Change

      1 comment:

      • File src/sync/map_test.go:

        • Patch Set #11, Line 352:

          	myMap.Store(key, val)

          if val1, ok := myMap.Load(key); !ok || val1 != val {
          t.Fatalf("Store: failed after clear %v:%v", key, val1)
          }

        • Store failing after clear succeeded

          Do you mean that after clearing, testing can store the same data? If so, please add a comment to explain.

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 11
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Hiro Hamada <laci...@gmail.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Fri, 08 Sep 2023 00:48:28 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      Hiro Hamada (Gerrit)

      unread,
      Sep 7, 2023, 8:53:15 PM9/7/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      1 comment:

      • File src/sync/map_test.go:

        • Patch Set #11, Line 352:

          	myMap.Store(key, val)

          if val1, ok := myMap.Load(key); !ok || val1 != val {
          t.Fatalf("Store: failed after clear %v:%v", key, val1)
          }

        • Do you mean that after clearing, testing can store the same data? If so, please add a comment to exp […]

          I thought the error message -"Store failed after clear" explains it. But yeah if its misleading perhaps we can have a comment

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 11
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Fri, 08 Sep 2023 00:53:09 +0000

      qiulaidongfeng (Gerrit)

      unread,
      Sep 7, 2023, 9:40:29 PM9/7/23
      to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Hiro Hamada, Ian Lance Taylor, Russ Cox.

      View Change

      1 comment:

      • File src/sync/map_test.go:

        • Patch Set #11, Line 352:

          	myMap.Store(key, val)

          if val1, ok := myMap.Load(key); !ok || val1 != val {
          t.Fatalf("Store: failed after clear %v:%v", key, val1)
          }

        • I thought the error message -"Store failed after clear" explains it. […]

          English is not my native language, and TestMapClear looks more like testing whether Clear can clear data.

          I think there are three solutions to the current situation:

          1. Change the name of the test to indicate that it will also test whether the same data can be stored after clearing.

          2. Add a comment to indicate that it will also test whether the same data can be stored after clearing.

          3. If you think it's a misunderstanding caused by my limited English proficiency, you can press the Done button on the dialog box to resolve this conversation.

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 11
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Hiro Hamada <laci...@gmail.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Fri, 08 Sep 2023 01:40:23 +0000

      Hiro Hamada (Gerrit)

      unread,
      Sep 8, 2023, 5:04:03 AM9/8/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Hiro Hamada, Ian Lance Taylor, Russ Cox.

      Will wait for a second opinion then.

      View Change

      1 comment:

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 11
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Hiro Hamada <laci...@gmail.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Fri, 08 Sep 2023 09:03:56 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      Hiro Hamada (Gerrit)

      unread,
      Sep 8, 2023, 5:48:35 AM9/8/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      1 comment:

      • File src/sync/map_test.go:

        • Patch Set #11, Line 352:

          	myMap.Store(key, val)

          if val1, ok := myMap.Load(key); !ok || val1 != val {
          t.Fatalf("Store: failed after clear %v:%v", key, val1)
          }

        • English is not my native language, and TestMapClear looks more like testing whether Clear can clear […]

          I think adding a comment on L352 should clear the confusion. Just in case, will wait for a second opinion then.

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 11
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Fri, 08 Sep 2023 09:48:27 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      qiulaidongfeng (Gerrit)

      unread,
      Sep 8, 2023, 7:04:50 AM9/8/23
      to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Hiro Hamada, Ian Lance Taylor, Russ Cox.

      View Change

      1 comment:

      • File src/sync/map_test.go:

        • Patch Set #11, Line 352:

          	myMap.Store(key, val)

          if val1, ok := myMap.Load(key); !ok || val1 != val {
          t.Fatalf("Store: failed after clear %v:%v", key, val1)
          }

        • I think adding a comment on L352 should clear the confusion. […]

          I think it's good.

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 11
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Hiro Hamada <laci...@gmail.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Fri, 08 Sep 2023 11:04:42 +0000

      Bryan Mills (Gerrit)

      unread,
      Sep 20, 2023, 12:56:47 PM9/20/23
      to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Dmitry Vyukov, Hiro Hamada, Ian Lance Taylor, Russ Cox.

      View Change

      11 comments:

      • File src/sync/map.go:

        • Patch Set #11, Line 160:

          (nit) Don't start a method body with a blank line.

        • Patch Set #11, Line 160:


          defer m.mu.Unlock()
          m.mu.Lock()

          Put the `m.mu.Lock` before the `defer m.mu.Unlock()`, so that the user gets a cleaner stack trace if `Lock` panics due to a nil receiver.

        • Patch Set #11, Line 164: m.read.Store(new(readOnly))

          We should avoid allocating a new `readOnly` here if the map was already empty and not amended.

          (And this should be confirmed with a test using `testing.AllocsPerRun`; see the existing `TestMapRangeNoAllocations`.)

        • Patch Set #11, Line 166: clear(m.dirty)

          Also set `m.misses = 0`, so that we don't immediately promote the newly-cleared `dirty` map on the next operation.

        • Patch Set #11, Line 167: }

          Putting it all together:
          ```
          read := m.loadReadOnly()
          if len(read.m) == 0 && !read.amended {
          return
          }
          	m.mu.Lock()
          defer m.mu.Unlock()
          	read = m.loadReadOnly()
          if len(read.m) > 0 || read.amended {
          m.read.Store(&readOnly{})
          }
          clear(m.dirty)
          m.misses = 0
          ```
      • File src/sync/map_test.go:

        • Patch Set #11, Line 299: var myMap sync.Map

          (https://go.dev/wiki/CodeReviewComments#variable-names)

          We don't typically use prefixes like `my` in Go code. (Name the map `m` like in the existing test cases.)

        • Patch Set #11, Line 310: if loadedVal != val {

          (https://go.dev/wiki/CodeReviewComments#variable-names)

          `v`, not `loadedVal`.

        • Patch Set #11, Line 316: nilVal, ok := myMap.Load(key)

          `v, ok = m.Load(k)`

        • Patch Set #11, Line 327: func TestMapClear(t *testing.T) {

          Rather than just testing `Clear` on its own, please add `Clear` methods to the other implementations in `map_reference_test.go`, an entry in the `mapOps` map, and a case in `mapCall.apply` so that the new method will be covered by the existing `TestMapMatchesRWMutex` and `TestMapMatchesDeepCopy` tests.

        • Patch Set #11, Line 328:

          Remove leading blank line.

        • Patch Set #11, Line 360:

          func TestMapClearRace(t *testing.T) {
          var myMap sync.Map

          wg := sync.WaitGroup{}
          wg.Add(30) // 10 goroutines for writing, 10 goroutines for reading, 10 goroutines for waiting

          // Writing data to the map concurrently
          for i := 0; i < 10; i++ {
          go func(key, value int) {
          defer wg.Done()
          myMap.Store(key, value)
          }(i, i*10)
          }

          // Reading data from the map concurrently
          for i := 0; i < 10; i++ {
          go func(key int) {
          defer wg.Done()
          if value, ok := myMap.Load(key); ok {
          t.Logf("Key: %v, Value: %v\n", key, value)
          } else {
          t.Logf("Key: %v not found\n", key)
          }
          }(i)
          }

          // Clearing data from the map concurrently
          for i := 0; i < 10; i++ {
          go func() {
          defer wg.Done()
          myMap.Clear()
          }()
          }

          wg.Wait()

          myMap.Clear()

          myMap.Range(func(key, val any) bool {
          t.Errorf("invalid %v:%v", key, val)

          return true
          })

          }

          The implementation of `Clear` seems simple enough not to need such an involved test, but it could be helpful to have a benchmark with a `perG` function that alternates among `Clear` and `Store` and `Load` with consistent keys; see the existing benchmarks in `map_bench_test.go`.

          (Note that the go project's `-race` builders also run each benchmark 1x during testing.)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 11
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Hiro Hamada <laci...@gmail.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Wed, 20 Sep 2023 16:56:42 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      Gerrit Bot (Gerrit)

      unread,
      Sep 20, 2023, 3:54:59 PM9/20/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Hiro Hamada, Ian Lance Taylor, Russ Cox.

      Gerrit Bot uploaded patch set #12 to this change.

      View Change

      The following approvals got outdated and were removed: LUCI-TryBot-Result+1 by Go LUCI

      sync: add Map.Clear

      For #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: 16207c84535db09b6d55788653d0075e5e0b5b62

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_test.go
      3 files changed, 119 insertions(+), 0 deletions(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 12
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>

      Gerrit Bot (Gerrit)

      unread,
      Sep 20, 2023, 4:02:31 PM9/20/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Hiro Hamada, Ian Lance Taylor, Russ Cox.

      Gerrit Bot uploaded patch set #13 to this change.

      View Change

      sync: add Map.Clear

      For #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: 67aa04ac732a2cf7e99bc0c392837845b557606e

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_test.go
      3 files changed, 130 insertions(+), 0 deletions(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 13

      Hiro Hamada (Gerrit)

      unread,
      Sep 20, 2023, 4:06:10 PM9/20/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

      View Change

      8 comments:

      • Patchset:

      • File src/sync/map.go:

        • Done

        • Put the `m.mu.Lock` before the `defer m.mu. […]

          Done

        • Putting it all together: […]

          Thanks, its done

      • File src/sync/map_test.go:

        • `v, ok = m. […]

          Done

        • Done

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 11
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Wed, 20 Sep 2023 20:06:00 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Bryan Mills <bcm...@google.com>

      Gerrit Bot (Gerrit)

      unread,
      Sep 20, 2023, 4:09:31 PM9/20/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

      Gerrit Bot uploaded patch set #14 to this change.

      View Change

      sync: add Map.Clear

      For #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: 817eccc6a0af158ff30e002144598c72367f7d78

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_test.go
      3 files changed, 129 insertions(+), 0 deletions(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 14

      Hiro Hamada (Gerrit)

      unread,
      Sep 20, 2023, 4:17:02 PM9/20/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

      View Change

      1 comment:

      • File src/sync/map_test.go:

        • Patch Set #11, Line 327: func TestMapClear(t *testing.T) {

          Rather than just testing `Clear` on its own, please add `Clear` methods to the other implementations […]

          couldn't find mapOps in _ref_test.go . SO adding it to` mapInterface` . Untested..

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 13
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Wed, 20 Sep 2023 20:16:54 +0000

      Hiro Hamada (Gerrit)

      unread,
      Sep 20, 2023, 4:18:11 PM9/20/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

      View Change

      2 comments:

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 14
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Wed, 20 Sep 2023 20:18:04 +0000

      Gerrit Bot (Gerrit)

      unread,
      Sep 20, 2023, 4:23:18 PM9/20/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

      Gerrit Bot uploaded patch set #15 to this change.

      View Change

      sync: add Map.Clear

      For #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: 140314fc1e15ddfe9aebad0deea5bfcb850a7bac

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_reference_test.go
      M src/sync/map_test.go
      4 files changed, 144 insertions(+), 0 deletions(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 15

      Gerrit Bot (Gerrit)

      unread,
      Sep 20, 2023, 4:30:26 PM9/20/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

      Gerrit Bot uploaded patch set #16 to this change.

      View Change

      sync: add Map.Clear

      For #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: e5cd229ebae671efb0940d8613571eb2095d97d9

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_reference_test.go
      M src/sync/map_test.go
      4 files changed, 144 insertions(+), 0 deletions(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 16

      Hiro Hamada (Gerrit)

      unread,
      Sep 20, 2023, 4:31:13 PM9/20/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

      View Change

      1 comment:

        • The implementation of `Clear` seems simple enough not to need such an involved test, but it could be […]

          The test was written to ensure that clear doesn't break on concurrent reads and writes.

          Since the existing tests with clear doesn't do concurrent reads,writes and loads.

          But I forgot to check if the values of the keys are corrupted when clear is run concurrently

          Do u think: I should implement a similar version with clear: https://github.com/golang/go/blob/817eccc6a0af158ff30e002144598c72367f7d78/src/sync/map_test.go#L188

          or remove this implementation.

          FYI: this test was written to be tested with -race flag.

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 14
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Wed, 20 Sep 2023 20:31:03 +0000

      Hiro Hamada (Gerrit)

      unread,
      Sep 20, 2023, 4:35:22 PM9/20/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com
      • File src/sync/map_test.go:

        • The test was written to ensure that clear doesn't break on concurrent reads and writes. […]

          working on the pefG function

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 16
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Wed, 20 Sep 2023 20:35:14 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Hiro Hamada <laci...@gmail.com>
      Comment-In-Reply-To: Bryan Mills <bcm...@google.com>

      Gerrit Bot (Gerrit)

      unread,
      Sep 20, 2023, 4:50:50 PM9/20/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

      Gerrit Bot uploaded patch set #17 to this change.

      View Change

      sync: add Map.Clear

      For #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: 4a35900c5bc6e52709fa95ba3315a819bd040d21

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_bench_test.go
      M src/sync/map_reference_test.go
      M src/sync/map_test.go
      5 files changed, 177 insertions(+), 1 deletion(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 17

      Hiro Hamada (Gerrit)

      unread,
      Sep 20, 2023, 4:55:23 PM9/20/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

      View Change

      1 comment:

      • File src/sync/map_test.go:

        • working on the pefG function

          I wrote the perfG function:
          ```
          perG: func(b *testing.B, pb *testing.PB, i int, m mapInterface) {
          for ; pb.Next(); i++ {
          k, v := i, i
          m.Clear()
          m.Store(k, v)
          v1, ok := m.Load(k)
          				if !ok {
          b.Errorf("failed to load %v", k)
          b.Skip()
          }
          				if v1.(int) != v {
          b.Errorf("expected %v, got %v", k, v)
          b.Skip()
          }
          			}
          },


          ```

          ```
          goos: darwin
          goarch: arm64
          pkg: sync
          BenchmarkClear
          BenchmarkClear/*sync_test.DeepCopyMap
          BenchmarkClear/*sync_test.DeepCopyMap-8 10000 905754 ns/op
          BenchmarkClear/*sync_test.RWMutexMap
          map_bench_test.go:555: failed to load 10000
          map_bench_test.go:556:
          map_bench_test.go:555: failed to load 70028
          map_bench_test.go:556:
          map_bench_test.go:555: failed to load 40143
          map_bench_test.go:556:
          map_bench_test.go:555: failed to load 60112
          map_bench_test.go:556:
          map_bench_test.go:555: failed to load 30153
          map_bench_test.go:556:
          map_bench_test.go:555: failed to load 20032
          map_bench_test.go:556:
          map_bench_test.go:555: failed to load 50461
          map_bench_test.go:556:
          --- FAIL: BenchmarkClear/*sync_test.RWMutexMap-8
          BenchmarkClear/*sync.Map
          map_bench_test.go:555: failed to load 1
          map_bench_test.go:556:
          map_bench_test.go:555: failed to load 100
          map_bench_test.go:556:
          --- FAIL: BenchmarkClear/*sync.Map-8
          --- FAIL: BenchmarkClear
          FAIL
          ```

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 17
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Wed, 20 Sep 2023 20:55:14 +0000

      Gerrit Bot (Gerrit)

      unread,
      Sep 20, 2023, 4:57:45 PM9/20/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

      Gerrit Bot uploaded patch set #18 to this change.

      View Change

      sync: add Map.Clear

      For #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: 5057ae03e18fdd8097c846d29c22e6b7125fe724

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_bench_test.go
      M src/sync/map_reference_test.go
      M src/sync/map_test.go
      5 files changed, 178 insertions(+), 1 deletion(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 18

      Gerrit Bot (Gerrit)

      unread,
      Sep 20, 2023, 5:04:50 PM9/20/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

      Gerrit Bot uploaded patch set #19 to this change.

      View Change

      sync: add Map.Clear

      For #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: 611741c47b3491ffc60f3eef00dd4a5243c2cddd

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_bench_test.go
      M src/sync/map_reference_test.go
      M src/sync/map_test.go
      5 files changed, 177 insertions(+), 1 deletion(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 19

      Bryan Mills (Gerrit)

      unread,
      Sep 25, 2023, 4:53:15 PM9/25/23
      to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

      View Change

      9 comments:

      • File src/sync/map.go:

        • Patch Set #19, Line 162: // avoid allocating a new readOnly here if the map was already empty and not amended

          (https://go.dev/wiki/CodeReviewComments#comment-sentences)

          Go comments should usually be complete sentences: start with a capital letter, and end with punctuation.

        • Patch Set #19, Line 162: // avoid allocating a new readOnly here if the map was already empty and not amended

          (nit) This comment could be more concise or at a higher level: the code already indicates that the map is “empty and not amended”.

          Perhaps:
          ```go
          // Avoid allocating a new readOnly when the map is already clear.
          return
          ```

        • Patch Set #19, Line 173: m.read.Store(new(readOnly))

          This line is redundant with line 171.

      • File src/sync/map_bench_test.go:

        • Patch Set #19, Line 541:

          		setup: func(_ *testing.B, m mapInterface) {
          for i := 0; i < mapSize; i++ {
          m.Store(i, i)
          }
          },

          This benchmark never reaches a steady state of keys, so there is no need to do work to prime it in the setup function.

        • Patch Set #19, Line 554: if !ok {

          This looks racy — isn't it possible for another goroutine to reach its `Clear` after this goroutine's `Store`?

        • Patch Set #19, Line 556: b.Skip()

          It's not safe to call `b.Skip` in a `perG` function, since those run in separate goroutines.

        • Patch Set #19, Line 563:

          (nit) Remove trailing blank line.

      • File src/sync/map_reference_test.go:

        • Patch Set #19, Line 285: m.dirty()

          This implementation is not correct. The `DeepCopyMap` needs an `m.clean.Store` at the end of each method to update the state.

          In this case, there is also no need to call `m.dirty()` to copy the existing contents. Instead, store a nil map:
          ```
          func (m *DeepCopyMap) Clear() {
          m.mu.Lock()
          defer m.mu.Unlock()
          m.clean.Store((map[any]any)(nil))
          }
          ```
      • File src/sync/map_test.go:

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 19
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Mon, 25 Sep 2023 20:53:12 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      Gerrit Bot (Gerrit)

      unread,
      Sep 25, 2023, 7:58:59 PM9/25/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

      Gerrit Bot uploaded patch set #20 to this change.

      View Change

      sync: add Map.Clear

      For #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: a6777d1f398385ac8c1551c6d6d87624e451110f

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_bench_test.go
      M src/sync/map_reference_test.go
      M src/sync/map_test.go
      5 files changed, 176 insertions(+), 1 deletion(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 20
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>

      Gerrit Bot (Gerrit)

      unread,
      Sep 25, 2023, 8:06:34 PM9/25/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

      Gerrit Bot uploaded patch set #21 to this change.

      View Change

      sync: add Map.Clear

      For #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: c08eb087da5ca7b4a3a560a1790a9c3c2c70ac5f

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_bench_test.go
      M src/sync/map_reference_test.go
      M src/sync/map_test.go
      5 files changed, 169 insertions(+), 1 deletion(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 21

      Hiro Hamada (Gerrit)

      unread,
      Sep 25, 2023, 8:29:55 PM9/25/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      9 comments:

      • File src/sync/map.go:

        • (nit) This comment could be more concise or at a higher level: the code already indicates that the m […]

          Done

        • My bad missed it....

      • File src/sync/map_bench_test.go:

        • This benchmark never reaches a steady state of keys, so there is no need to do work to prime it in t […]

          yes there is no need of setup

        • Acknowledged

      • File src/sync/map_reference_test.go:

        • This implementation is not correct. The `DeepCopyMap` needs an `m.clean. […]

          Done. What bout the L152, implementation of CLear in RWMutex map

      • File src/sync/map_test.go:

        • couldn't find mapOps in _ref_test.go . SO adding it to` mapInterface` . Untested..

        • 	myMap.Store(key, val)

          if val1, ok := myMap.Load(key); !ok || val1 != val {
          t.Fatalf("Store: failed after clear %v:%v", key, val1)
          }

        • I think it's good.

          Acknowledged

      • File src/sync/map_test.go:

        • Done

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 19
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Tue, 26 Sep 2023 00:29:45 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Bryan Mills <bcm...@google.com>
      Comment-In-Reply-To: Hiro Hamada <laci...@gmail.com>
      Comment-In-Reply-To: qiulaidongfeng <26454...@qq.com>

      Gerrit Bot (Gerrit)

      unread,
      Sep 25, 2023, 8:31:14 PM9/25/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      Gerrit Bot uploaded patch set #22 to this change.

      View Change

      sync: add Map.Clear

      For #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: 689e8750eec64df41284ecab745c348342394c6d

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_bench_test.go
      M src/sync/map_reference_test.go
      M src/sync/map_test.go
      5 files changed, 174 insertions(+), 1 deletion(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 22

      Gerrit Bot (Gerrit)

      unread,
      Sep 25, 2023, 9:10:27 PM9/25/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      Gerrit Bot uploaded patch set #23 to this change.

      View Change

      sync: add Map.Clear

      For #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: ebc1375b7ead16bcd7cb0b685ed03b152f07ac50

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_bench_test.go
      M src/sync/map_reference_test.go
      M src/sync/map_test.go
      5 files changed, 178 insertions(+), 1 deletion(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 23

      Hiro Hamada (Gerrit)

      unread,
      Sep 25, 2023, 9:14:30 PM9/25/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      2 comments:

      • File src/sync/map_bench_test.go:

        • It's not safe to call `b.Skip` in a `perG` function, since those run in separate goroutines.

        • Done

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 21
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Tue, 26 Sep 2023 01:14:21 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      Gerrit Bot (Gerrit)

      unread,
      Sep 25, 2023, 9:17:48 PM9/25/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      Gerrit Bot uploaded patch set #24 to this change.

      View Change

      sync: add Map.Clear

      Fixes #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: d11b339b872dd47c87f186f49ab152da9fb33c5e

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_bench_test.go
      M src/sync/map_reference_test.go
      M src/sync/map_test.go
      5 files changed, 182 insertions(+), 1 deletion(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 24

      Hiro Hamada (Gerrit)

      unread,
      Sep 25, 2023, 9:17:51 PM9/25/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      3 comments:

        • I wrote the perfG function: […]

          Done

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 23
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Tue, 26 Sep 2023 01:17:43 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Bryan Mills <bcm...@google.com>
      Comment-In-Reply-To: Hiro Hamada <laci...@gmail.com>
      Comment-In-Reply-To: qiulaidongfeng <26454...@qq.com>

      Bryan Mills (Gerrit)

      unread,
      Sep 26, 2023, 3:45:59 PM9/26/23
      to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Dmitry Vyukov, Hiro Hamada, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      7 comments:

      • File src/sync/map.go:

        • Patch Set #11, Line 164: m.read.Store(new(readOnly))

          Done

          I'm not seeing an `AllocsPerRun` test for this — has it been added?

      • File src/sync/map_bench_test.go:

        • Patch Set #24, Line 547: b.StartTimer() // racy but to benchmark this is crucial

          This mutex and timer manipulation is not appropriate in a benchmark — if a benchmark is not as simple as possible, it is likely to be too noisy or biased to be useful.

          In general it is fine for a benchmark of a data structure (like `sync.Map`) to measure a mix of function calls, rather than just a single function call — real programs will execute a mix of function calls too, so that kind of benchmark will actually be more useful for measuring real-world performance.

          That said: to avoid spurious allocations from the `Store` call, I would suggest using `i%256` instead of `i` so that the interface conversions for `Store` don't require extra allocations (see `runtime.staticuint64s`).

        • Patch Set #24, Line 552:

        • 				v1, ok := m.Load(k)

          if !ok {

        • 					b.Logf("failed to load %v", k)
          // b.Skip() Unsafe to call in perfG
          continue


        • }

          if v1.(int) != v {
          b.Errorf("expected %v, got %v", k, v)

        • 					// b.Skip()
          continue
          }
          }

          I suggest skipping the `Load` calls entirely in this benchmark — given concurrency there is no guarantee as to what `Load` will return, and we can meaningfully benchmark `Clear` without it.

      • File src/sync/map_reference_test.go:

        • Done. […]

          That one is correct: the `RWMutexMap` implementation is supposed to measure the difference between `map[any][any]` and `sync.Map`.

      • File src/sync/map_test.go:

        • Patch Set #24, Line 303:

          func TestMapDelete(t *testing.T) {
          var m sync.Map

          k := "go"
          val := 1.22
          m.Store(k, val)
          v, ok := m.Load(k)

          if !ok {
          t.Fatalf("Store failed to store- %v:%v", k, val)
          }

          if v != val {
          t.Fatalf("Load: invalid value- %v:%v", k, v)
          }

          m.Delete(k)

          v, ok = m.Load(k)

          if v != nil {
          t.Fatalf("Delete: failed %v:%v", k, v)
          }

          if ok {
          t.Fatalf("Delete: failed found %v:%v", k, v)
          }
          }

          func TestMapClear(t *testing.T) {
          var m sync.Map

          key := "go"
          val := 1.21
          m.Store(key, val)
          v, ok := m.Load(key)

          if !ok {
          t.Fatalf("Store failed to store- %v:%v", key, val)
          }

          if v != val {
          t.Fatalf("Load: invalid value- %v:%v", key, v)
          }

          m.Clear()

          nilVal, ok := m.Load(key)

          if nilVal != nil || ok {
          t.Fatalf("Clear: failed %v:%v", key, nilVal)
          }

          m.Store(key, val)

          if val1, ok := m.Load(key); !ok || val1 != val {


        • t.Fatalf("Store: failed after clear %v:%v", key, val1)
          }

          }

        • Given that `Delete` and `Clear` should be covered by `TestMapMatchesRWMutex` and `TestMapMatchesDeepCopy`, I don't think we need separate sequential tests for them. (Those tests should already exercise these sequences and more.)

        • Patch Set #24, Line 364: func TestConcurrentClear(t *testing.T) {

          A comment for this test would be helpful — what properties is it checking for? What kind of failure modes would we expect to see in case of a bug?

        • Patch Set #24, Line 403: invalid

          (https://go.dev/wiki/CodeReviewComments#useful-test-failures)

          Instead of just “invalid”, describe what was expected or not, and the relevant calls that led up to that expectation. For example:

          ```go
          t.Errorf("after Clear, Range yielded (%v, %v); want no calls", k, v)
          ```

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 24
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Hiro Hamada <laci...@gmail.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Tue, 26 Sep 2023 19:45:54 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      Gerrit Bot (Gerrit)

      unread,
      Sep 26, 2023, 6:34:07 PM9/26/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Hiro Hamada, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      Gerrit Bot uploaded patch set #25 to this change.

      View Change

      sync: add Map.Clear

      Fixes #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: 6bf739cb31fbbf22ba094e236faf118505d06f2b

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_bench_test.go
      M src/sync/map_reference_test.go
      M src/sync/map_test.go
      5 files changed, 178 insertions(+), 1 deletion(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 25
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>

      Gerrit Bot (Gerrit)

      unread,
      Sep 26, 2023, 6:42:06 PM9/26/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Hiro Hamada, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      Gerrit Bot uploaded patch set #26 to this change.

      View Change

      sync: add Map.Clear

      Fixes #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: 166f86fdcdd84ed7e745cbd4cc857a63108083fa

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_bench_test.go
      M src/sync/map_reference_test.go
      M src/sync/map_test.go
      5 files changed, 180 insertions(+), 1 deletion(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 26

      Hiro Hamada (Gerrit)

      unread,
      Sep 26, 2023, 6:45:52 PM9/26/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      4 comments:

      • File src/sync/map.go:

        • I'm not seeing an `AllocsPerRun` test for this — has it been added?

          No, working on it

      • File src/sync/map_bench_test.go:

        • Patch Set #24, Line 547: b.StartTimer() // racy but to benchmark this is crucial

          >This mutex and timer manipulation is not appropriate in a benchmark

        • Ok

          i%256 fits 1 byte. So less no of allocations at `Store` and `Type Assertion`
          ok

        • Patch Set #24, Line 552:

          				v1, ok := m.Load(k)

          if !ok {
          b.Logf("failed to load %v", k)
          // b.Skip() Unsafe to call in perfG
          continue
          }

          if v1.(int) != v {
          b.Errorf("expected %v, got %v", k, v)
          // b.Skip()
          continue
          }
          }

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 24
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Tue, 26 Sep 2023 22:45:43 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      Gerrit Bot (Gerrit)

      unread,
      Sep 26, 2023, 6:50:06 PM9/26/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      Gerrit Bot uploaded patch set #27 to this change.

      View Change

      sync: add Map.Clear

      Fixes #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: 3b231bdc8e4303893d93b604206439835341f561

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_bench_test.go
      M src/sync/map_reference_test.go
      M src/sync/map_test.go
      5 files changed, 197 insertions(+), 1 deletion(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 27

      Hiro Hamada (Gerrit)

      unread,
      Sep 26, 2023, 6:50:21 PM9/26/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      1 comment:

      • File src/sync/map.go:

        • No, working on it

          Wrote: AllocsPerRun for Clear based on Range: Got it passing

          === RUN TestMapClearNoAllocations
          --- PASS: TestMapClearNoAllocations (0.00s)
          PASS

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 26
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Tue, 26 Sep 2023 22:50:14 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      Hiro Hamada (Gerrit)

      unread,
      Sep 26, 2023, 6:52:41 PM9/26/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      1 comment:

      • File src/sync/map_test.go:

        • Patch Set #24, Line 364: func TestConcurrentClear(t *testing.T) {

          A comment for this test would be helpful — what properties is it checking for? What kind of failure […]

          Done

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 27
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Tue, 26 Sep 2023 22:52:34 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Bryan Mills <bcm...@google.com>

      Hiro Hamada (Gerrit)

      unread,
      Sep 26, 2023, 6:54:54 PM9/26/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      1 comment:

      • File src/sync/map.go:

        • Wrote: AllocsPerRun for Clear based on Range: Got it passing […]

          Sorry i have made the change, but even why i took it off the tests are passing

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 27
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Tue, 26 Sep 2023 22:54:46 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      Hiro Hamada (Gerrit)

      unread,
      Sep 26, 2023, 6:55:51 PM9/26/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      1 comment:

      • File src/sync/map.go:

        • Sorry i have made the change, but even why i took it off the tests are passing

          I mean even why i commented the check for empty, tests were passing

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 27
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Tue, 26 Sep 2023 22:55:44 +0000

      Hiro Hamada (Gerrit)

      unread,
      Sep 26, 2023, 7:01:34 PM9/26/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      1 comment:

        • func TestMapDelete(t *testing.T) {
          var m sync.Map

          k := "go"
          val := 1.22
          m.Store(k, val)

        • 	v, ok := m.Load(k)

          if !ok {

        • Given that `Delete` and `Clear` should be covered by `TestMapMatchesRWMutex` and `TestMapMatchesDeep […]

          So integration test for Delete And Clear is not required, ok very well I don't see for load, store either. My bad!!

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 27
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Tue, 26 Sep 2023 23:01:28 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Bryan Mills <bcm...@google.com>

      Hiro Hamada (Gerrit)

      unread,
      Sep 26, 2023, 7:02:45 PM9/26/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com
      • File src/sync/map_test.go:

        • So integration test for Delete And Clear is not required, ok very well I don't see for load, store e […]

          Done

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 27
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Tue, 26 Sep 2023 23:02:38 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      Gerrit Bot (Gerrit)

      unread,
      Sep 26, 2023, 7:05:57 PM9/26/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      Gerrit Bot uploaded patch set #28 to this change.

      View Change

      sync: add Map.Clear

      Fixes #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: 77501052f421a502a9f8a0f2a04182bd33b3b465

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_bench_test.go
      M src/sync/map_reference_test.go
      M src/sync/map_test.go
      5 files changed, 136 insertions(+), 1 deletion(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 28

      Bryan Mills (Gerrit)

      unread,
      Sep 28, 2023, 12:02:28 PM9/28/23
      to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Dmitry Vyukov, Hiro Hamada, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      5 comments:

      • File src/sync/map.go:

        • I mean even why i commented the check for empty, tests were passing

          The `if len(read.m) > 0 || read.amended {` check within the locked section avoids unnecessary allocations if multiple goroutines call `Clear` on a non-empty map simultaneously.

          I would expect that to show up as a (moderate to small) difference in the number of allocations in `BenchmarkClear`, once the `sync.Mutex` is removed from that benchmark.

      • File src/sync/map_bench_test.go:


        • b.Logf("failed to load %v", k)
          // b.Skip() Unsafe to call in perfG
          continue
          }

          if v1.(int) != v {
          b.Errorf("expected %v, got %v", k, v)
          // b.Skip()
          continue
          }
          }

      • File src/sync/map_bench_test.go:

        • Patch Set #28, Line 544: mu.Lock()

          Again, please drop the mutex here — there is no need for it, and contention on the mutex will almost certainly bias the benchmark results by preventing multiple goroutines from running `Clear` concurrently.

        • Patch Set #28, Line 548:

          				// Skipping load calls due to concurrency
          /*
          v1, ok := m.Load(k)

          if !ok {


        • b.Logf("failed to load %v", k)
          // b.Skip() Unsafe to call in perfG
          continue
          }

          if v1.(int) != v {
          b.Errorf("expected %v, got %v", k, v)
          // b.Skip()
          continue

        • 					}*/

          Don't leave commented-out code — it is unlikely that we would ever uncomment it, and not particularly essential to the benchmark (lots of real programs store to maps of monitoring data with ~0 loads in the steady state).

      • File src/sync/map_test.go:

        • Patch Set #28, Line 303: tests the concurrent behavior of the sync.Map

          Please make this comment shorter and more specific: it should focus on _what_ properties are being checked, not _how_ they are being checked. (Does this verify that concurrent calls to `Clear` and `Store` do not produce data races? Something else?)

          The comment doesn't need to include the details about the specific goroutines, because we can read the code to figure that out if the test fails.

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 28
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Hiro Hamada <laci...@gmail.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Thu, 28 Sep 2023 16:02:22 +0000

      Hiro Hamada (Gerrit)

      unread,
      Sep 28, 2023, 10:31:36 PM9/28/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      2 comments:

      • File src/sync/map_test.go:

      • File src/sync/map_test.go:

        • Please make this comment shorter and more specific: it should focus on _what_ properties are being c […]

          Done

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 28
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Fri, 29 Sep 2023 02:31:28 +0000

      Hiro Hamada (Gerrit)

      unread,
      Sep 28, 2023, 10:33:06 PM9/28/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      1 comment:

      • File src/sync/map_bench_test.go:

        • Again, please drop the mutex here — there is no need for it, and contention on the mutex will almost […]

          Done

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 28
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Fri, 29 Sep 2023 02:32:59 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Bryan Mills <bcm...@google.com>

      Gerrit Bot (Gerrit)

      unread,
      Sep 28, 2023, 10:33:56 PM9/28/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      Gerrit Bot uploaded patch set #29 to this change.

      View Change

      sync: add Map.Clear

      Fixes #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: 61ecacc04e10111853bc7d4ed808c14df0222b68

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_bench_test.go
      M src/sync/map_reference_test.go
      M src/sync/map_test.go
      5 files changed, 130 insertions(+), 1 deletion(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 29

      Hiro Hamada (Gerrit)

      unread,
      Sep 28, 2023, 10:50:53 PM9/28/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      1 comment:

      • File src/sync/map.go:

        • The `if len(read.m) > 0 || read. […]

          setup_call: go test -c -race

          1. BenchmarkClear without Load Calls

          i) i) with check for empty map in Clear

          goos: darwin
          goarch: arm64
          pkg: sync
          BenchmarkClear
          BenchmarkClear/*sync_test.DeepCopyMap
          BenchmarkClear/*sync_test.DeepCopyMap-8 363613 2946 ns/op
          BenchmarkClear/*sync_test.RWMutexMap
          BenchmarkClear/*sync_test.RWMutexMap-8 525649 2621 ns/op
          BenchmarkClear/*sync.Map
          BenchmarkClear/*sync.Map-8 280063 7898 ns/op
          PASS

          goos: darwin
          goarch: arm64
          pkg: sync
          BenchmarkClear
          BenchmarkClear/*sync_test.DeepCopyMap
          BenchmarkClear/*sync_test.DeepCopyMap-8 467364 2432 ns/op
          BenchmarkClear/*sync_test.RWMutexMap
          BenchmarkClear/*sync_test.RWMutexMap-8 753368 1588 ns/op
          BenchmarkClear/*sync.Map
          BenchmarkClear/*sync.Map-8 388039 3165 ns/op
          PASS

          goos: darwin
          goarch: arm64
          pkg: sync
          BenchmarkClear
          BenchmarkClear/*sync_test.DeepCopyMap
          BenchmarkClear/*sync_test.DeepCopyMap-8 471136 2255 ns/op
          BenchmarkClear/*sync_test.RWMutexMap
          BenchmarkClear/*sync_test.RWMutexMap-8 663817 1596 ns/op
          BenchmarkClear/*sync.Map
          BenchmarkClear/*sync.Map-8 387192 3133 ns/op
          PASS

          ii) without check for empty map in Clear

          goos: darwin
          goarch: arm64
          pkg: sync
          BenchmarkClear
          BenchmarkClear/*sync_test.DeepCopyMap
          BenchmarkClear/*sync_test.DeepCopyMap-8 471284 3348 ns/op
          BenchmarkClear/*sync_test.RWMutexMap
          BenchmarkClear/*sync_test.RWMutexMap-8 636710 1675 ns/op
          BenchmarkClear/*sync.Map
          BenchmarkClear/*sync.Map-8 388240 3132 ns/op
          PASS

          goos: darwin
          goarch: arm64
          pkg: sync
          BenchmarkClear
          BenchmarkClear/*sync_test.DeepCopyMap
          BenchmarkClear/*sync_test.DeepCopyMap-8 460369 2824 ns/op
          BenchmarkClear/*sync_test.RWMutexMap
          BenchmarkClear/*sync_test.RWMutexMap-8 703011 1611 ns/op
          BenchmarkClear/*sync.Map
          BenchmarkClear/*sync.Map-8 386132 3143 ns/op
          PASS

          goos: darwin
          goarch: arm64
          pkg: sync
          BenchmarkClear
          BenchmarkClear/*sync_test.DeepCopyMap
          BenchmarkClear/*sync_test.DeepCopyMap-8 462972 2674 ns/op
          BenchmarkClear/*sync_test.RWMutexMap
          BenchmarkClear/*sync_test.RWMutexMap-8 702590 1607 ns/op
          BenchmarkClear/*sync.Map
          BenchmarkClear/*sync.Map-8 389812 3117 ns/op
          PASS


          2. BenchmarkClear with Load Calls

          i) with check for empty map in Clear

          goos: darwin
          goarch: arm64
          pkg: sync
          BenchmarkClear
          BenchmarkClear/*sync_test.DeepCopyMap
          BenchmarkClear/*sync_test.DeepCopyMap-8 393286 2641 ns/op
          BenchmarkClear/*sync_test.RWMutexMap
          BenchmarkClear/*sync_test.RWMutexMap-8 511614 2387 ns/op
          BenchmarkClear/*sync.Map
          BenchmarkClear/*sync.Map-8 249514 4807 ns/op
          PASS

          goos: darwin
          goarch: arm64
          pkg: sync
          BenchmarkClear
          BenchmarkClear/*sync_test.DeepCopyMap
          BenchmarkClear/*sync_test.DeepCopyMap-8 306735 3774 ns/op
          BenchmarkClear/*sync_test.RWMutexMap
          BenchmarkClear/*sync_test.RWMutexMap-8 411452 2948 ns/op
          BenchmarkClear/*sync.Map
          BenchmarkClear/*sync.Map-8 199868 6404 ns/op
          PASS


          ii) without check for empty map in Clear

          goos: darwin
          goarch: arm64
          pkg: sync
          BenchmarkClear
          BenchmarkClear/*sync_test.DeepCopyMap
          BenchmarkClear/*sync_test.DeepCopyMap-8 450927 2620 ns/op
          BenchmarkClear/*sync_test.RWMutexMap
          BenchmarkClear/*sync_test.RWMutexMap-8 509013 2388 ns/op
          BenchmarkClear/*sync.Map
          BenchmarkClear/*sync.Map-8 249022 4768 ns/op
          PASS

          goos: darwin
          goarch: arm64
          pkg: sync
          BenchmarkClear
          BenchmarkClear/*sync_test.DeepCopyMap
          BenchmarkClear/*sync_test.DeepCopyMap-8 458102 2637 ns/op
          BenchmarkClear/*sync_test.RWMutexMap
          BenchmarkClear/*sync_test.RWMutexMap-8 513540 2367 ns/op
          BenchmarkClear/*sync.Map
          BenchmarkClear/*sync.Map-8 250668 4850 ns/op
          PASS

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 28
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Fri, 29 Sep 2023 02:50:46 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Bryan Mills <bcm...@google.com>
      Comment-In-Reply-To: Hiro Hamada <laci...@gmail.com>

      Hiro Hamada (Gerrit)

      unread,
      Sep 28, 2023, 10:54:55 PM9/28/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      1 comment:

      • File src/sync/map_bench_test.go:

        • Patch Set #24, Line 552:

          				v1, ok := m.Load(k)

          if !ok {
          b.Logf("failed to load %v", k)
          // b.Skip() Unsafe to call in perfG
          continue
          }

          if v1.(int) != v {
          b.Errorf("expected %v, got %v", k, v)
          // b.Skip()
          continue
          }
          }

        • I guess, but why? […]

          Done

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 29
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Fri, 29 Sep 2023 02:54:46 +0000

      Gerrit Bot (Gerrit)

      unread,
      Sep 28, 2023, 10:54:57 PM9/28/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      Gerrit Bot uploaded patch set #30 to this change.

      View Change

      sync: add Map.Clear

      Fixes #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: 8ebf4c883cd4d88809391fb392799fd781620eaf

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_bench_test.go
      M src/sync/map_reference_test.go
      M src/sync/map_test.go
      5 files changed, 116 insertions(+), 1 deletion(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 30

      Hiro Hamada (Gerrit)

      unread,
      Sep 28, 2023, 10:55:30 PM9/28/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      2 comments:

      • File src/sync/map.go:

        • 				// Skipping load calls due to concurrency
          /*

        • 					v1, ok := m.Load(k)

          if !ok {
          b.Logf("failed to load %v", k)
          // b.Skip() Unsafe to call in perfG
          continue
          }

          if v1.(int) != v {
          b.Errorf("expected %v, got %v", k, v)
          // b.Skip()
          continue

        • 					}*/

          Don't leave commented-out code — it is unlikely that we would ever uncomment it, and not particularl […]

          Done

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 29
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Fri, 29 Sep 2023 02:55:22 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      Gerrit Bot (Gerrit)

      unread,
      Sep 28, 2023, 11:02:22 PM9/28/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      Gerrit Bot uploaded patch set #31 to this change.

      View Change

      sync: add Map.Clear

      Fixes #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: 80eb8f871fcdc4df1e185067b6e6bc9d3ec91340

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_bench_test.go
      M src/sync/map_reference_test.go
      M src/sync/map_test.go
      5 files changed, 115 insertions(+), 1 deletion(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 31

      Gerrit Bot (Gerrit)

      unread,
      Oct 21, 2023, 6:22:21 AM10/21/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      Gerrit Bot uploaded patch set #32 to this change.

      View Change

      sync: add Map.Clear

      Fixes #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: 43e80a0fc88a71f8b190923cad7bce291ad9aef6

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_bench_test.go
      M src/sync/map_reference_test.go
      M src/sync/map_test.go
      5 files changed, 115 insertions(+), 1 deletion(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 32

      Hiro Hamada (Gerrit)

      unread,
      Oct 23, 2023, 11:47:45 AM10/23/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, qiulaidongfeng, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      1 comment:

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 32
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-CC: qiulaidongfeng <26454...@qq.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Mon, 23 Oct 2023 15:47:36 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      qiulaidongfeng (Gerrit)

      unread,
      Nov 16, 2023, 11:21:30 PM11/16/23
      to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Bryan Mills, Russ Cox, Austin Clements, Dmitry Vyukov, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

      Patch set 32:Run-TryBot +1Code-Review +1

      View Change

      1 comment:

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 32
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Fri, 17 Nov 2023 04:21:25 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes

      Hiro Hamada (Gerrit)

      unread,
      Nov 17, 2023, 3:15:49 AM11/17/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Gopher Robot, qiulaidongfeng, Go LUCI, Ian Lance Taylor, Bryan Mills, Russ Cox, Austin Clements, Dmitry Vyukov, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

      View Change

      1 comment:

      • Patchset:

        • Patch Set #32:

          1 of 46 TryBots failed. […]

          why is this error poping up?

          ```
          go: downloading github.com/BurntSushi/toml v1.2.1
          ../internal/versions/versions_go122.go:11:2: package go/version is not in std (/workdir/go/src/go/version)


          Error: tests failed: exit status 1; exit status 1
          ```
          the dep wasn't intro'ed by this CL

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 32
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Fri, 17 Nov 2023 08:15:43 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Gopher Robot <go...@golang.org>

      qiulaidongfeng (Gerrit)

      unread,
      Nov 17, 2023, 4:15:28 AM11/17/23
      to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Gopher Robot, Go LUCI, Ian Lance Taylor, Bryan Mills, Russ Cox, Austin Clements, Dmitry Vyukov, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Hiro Hamada, Ian Lance Taylor, Russ Cox.

      Patch set 32:-Run-TryBot

      View Change

      1 comment:

      • Patchset:

        • Patch Set #32:

          why is this error poping up? […]

          Run git codereview sync to fix it.

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 32
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-Attention: Hiro Hamada <laci...@gmail.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Fri, 17 Nov 2023 09:15:22 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Hiro Hamada <laci...@gmail.com>
      Comment-In-Reply-To: Gopher Robot <go...@golang.org>

      Hiro Hamada (Gerrit)

      unread,
      Nov 17, 2023, 4:37:17 AM11/17/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Gopher Robot, qiulaidongfeng, Go LUCI, Ian Lance Taylor, Bryan Mills, Russ Cox, Austin Clements, Dmitry Vyukov, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      1 comment:

      • Patchset:

        • Patch Set #32:

          Run git codereview sync to fix it.

          ok. I need to update the branch i guess

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 32
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Fri, 17 Nov 2023 09:37:12 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Hiro Hamada <laci...@gmail.com>
      Comment-In-Reply-To: Gopher Robot <go...@golang.org>
      Comment-In-Reply-To: qiulaidongfeng <26454...@qq.com>

      Hiro Hamada (Gerrit)

      unread,
      Nov 17, 2023, 7:10:33 AM11/17/23
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Gopher Robot, qiulaidongfeng, Go LUCI, Ian Lance Taylor, Bryan Mills, Russ Cox, Austin Clements, Dmitry Vyukov, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      View Change

      1 comment:

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 32
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
      Gerrit-CC: Hiro Hamada <laci...@gmail.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
      Gerrit-Comment-Date: Fri, 17 Nov 2023 12:10:27 +0000

      Gerrit Bot (Gerrit)

      unread,
      Nov 17, 2023, 7:13:46 AM11/17/23
      to Hiro Hamada, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox, qiulaidongfeng.

      Gerrit Bot uploaded patch set #33 to this change.

      View Change

      The following approvals got outdated and were removed: TryBot-Result-1 by Gopher Robot

      sync: add Map.Clear

      Fixes #61696

      Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      GitHub-Last-Rev: c4237d7f09530c80cd8efe67de68bf84fb62c405

      GitHub-Pull-Request: golang/go#61702
      ---
      A api/next/61696.txt
      M src/sync/map.go
      M src/sync/map_bench_test.go
      M src/sync/map_reference_test.go
      M src/sync/map_test.go
      5 files changed, 115 insertions(+), 1 deletion(-)

      To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
      Gerrit-Change-Number: 515015
      Gerrit-PatchSet: 33

      qiulaidongfeng (Gerrit)

      unread,
      Nov 17, 2023, 7:34:00 AM11/17/23
      to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Gopher Robot, Go LUCI, Ian Lance Taylor, Bryan Mills, Russ Cox, Austin Clements, Dmitry Vyukov, golang-co...@googlegroups.com

      Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

      Patch set 33:Run-TryBot +1Code-Review +1

      View Change

        To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
        Gerrit-Change-Number: 515015
        Gerrit-PatchSet: 33
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Austin Clements <aus...@google.com>
        Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
        Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Reviewer: Russ Cox <r...@golang.org>
        Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
        Gerrit-CC: Hiro Hamada <laci...@gmail.com>
        Gerrit-Attention: Bryan Mills <bcm...@google.com>
        Gerrit-Attention: Austin Clements <aus...@google.com>
        Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Attention: Russ Cox <r...@golang.org>
        Gerrit-Comment-Date: Fri, 17 Nov 2023 12:33:56 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes

        Hiro Hamada (Gerrit)

        unread,
        Nov 17, 2023, 8:01:15 AM11/17/23
        to Gerrit Bot, goph...@pubsubhelper.golang.org, Gopher Robot, qiulaidongfeng, Go LUCI, Ian Lance Taylor, Bryan Mills, Russ Cox, Austin Clements, Dmitry Vyukov, golang-co...@googlegroups.com

        Attention is currently required from: Austin Clements, Bryan Mills, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

        View Change

        1 comment:

        To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
        Gerrit-Change-Number: 515015
        Gerrit-PatchSet: 33
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Austin Clements <aus...@google.com>
        Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
        Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Reviewer: Russ Cox <r...@golang.org>
        Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
        Gerrit-CC: Hiro Hamada <laci...@gmail.com>
        Gerrit-Attention: Bryan Mills <bcm...@google.com>
        Gerrit-Attention: Austin Clements <aus...@google.com>
        Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Attention: Russ Cox <r...@golang.org>
        Gerrit-Comment-Date: Fri, 17 Nov 2023 13:01:09 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Gopher Robot <go...@golang.org>

        Bryan Mills (Gerrit)

        unread,
        Nov 17, 2023, 10:48:36 AM11/17/23
        to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Bryan Mills, Gopher Robot, qiulaidongfeng, Go LUCI, Ian Lance Taylor, Russ Cox, Austin Clements, Dmitry Vyukov, golang-co...@googlegroups.com

        Attention is currently required from: Austin Clements, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

        Patch set 33:Code-Review +2Commit-Queue +1

        View Change

          To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

          Gerrit-MessageType: comment
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
          Gerrit-Change-Number: 515015
          Gerrit-PatchSet: 33
          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
          Gerrit-Reviewer: Austin Clements <aus...@google.com>
          Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
          Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
          Gerrit-Reviewer: Gopher Robot <go...@golang.org>
          Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
          Gerrit-Reviewer: Russ Cox <r...@golang.org>
          Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
          Gerrit-CC: Hiro Hamada <laci...@gmail.com>
          Gerrit-Attention: Austin Clements <aus...@google.com>
          Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
          Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
          Gerrit-Attention: Russ Cox <r...@golang.org>
          Gerrit-Comment-Date: Fri, 17 Nov 2023 15:48:31 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes

          Bryan Mills (Gerrit)

          unread,
          Nov 17, 2023, 11:44:17 AM11/17/23
          to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Bryan Mills, Go LUCI, Gopher Robot, qiulaidongfeng, Ian Lance Taylor, Russ Cox, Austin Clements, Dmitry Vyukov, golang-co...@googlegroups.com

          Attention is currently required from: Austin Clements, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

          Patch set 33:Auto-Submit +1

          View Change

            To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

            Gerrit-MessageType: comment
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
            Gerrit-Change-Number: 515015
            Gerrit-PatchSet: 33
            Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
            Gerrit-Reviewer: Austin Clements <aus...@google.com>
            Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
            Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
            Gerrit-Reviewer: Gopher Robot <go...@golang.org>
            Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
            Gerrit-Reviewer: Russ Cox <r...@golang.org>
            Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
            Gerrit-CC: Hiro Hamada <laci...@gmail.com>
            Gerrit-Attention: Austin Clements <aus...@google.com>
            Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
            Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
            Gerrit-Attention: Russ Cox <r...@golang.org>
            Gerrit-Comment-Date: Fri, 17 Nov 2023 16:44:13 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes

            Bryan Mills (Gerrit)

            unread,
            Dec 12, 2023, 5:05:44 PM12/12/23
            to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Bryan Mills, Go LUCI, Gopher Robot, qiulaidongfeng, Ian Lance Taylor, Russ Cox, Austin Clements, Dmitry Vyukov, golang-co...@googlegroups.com

            Attention is currently required from: Austin Clements, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

            Bryan Mills removed a vote from this change.

            View Change

            Removed Hold+1 by Russ Cox <r...@golang.org>

            To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

            Gerrit-MessageType: deleteVote

            Bryan Mills (Gerrit)

            unread,
            Dec 12, 2023, 5:06:53 PM12/12/23
            to Hiro Hamada, Gerrit Bot, goph...@pubsubhelper.golang.org, Bryan Mills, Go LUCI, Gopher Robot, qiulaidongfeng, Ian Lance Taylor, Russ Cox, Austin Clements, Dmitry Vyukov, golang-co...@googlegroups.com

            Attention is currently required from: Austin Clements, Dmitry Vyukov, Ian Lance Taylor, Russ Cox.

            View Change

            1 comment:

            • Patchset:

              • Patch Set #33:

                This missed the release window because I hadn't noticed it still had a Hold+1 vote from Russ pending proposal discussion. Since the proposal is now approved, I have removed the Hold+1; this should be good to go in when the window opens for Go 1.23.

            To view, visit change 515015. To unsubscribe, or for help writing mail filters, visit settings.

            Gerrit-MessageType: comment
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I0a31afd3bc433fc84280d56f2798bda10da61eba
            Gerrit-Change-Number: 515015
            Gerrit-PatchSet: 33
            Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
            Gerrit-Reviewer: Austin Clements <aus...@google.com>
            Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
            Gerrit-Reviewer: Dmitry Vyukov <dvy...@google.com>
            Gerrit-Reviewer: Gopher Robot <go...@golang.org>
            Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
            Gerrit-Reviewer: Russ Cox <r...@golang.org>
            Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
            Gerrit-CC: Hiro Hamada <laci...@gmail.com>
            Gerrit-Attention: Austin Clements <aus...@google.com>
            Gerrit-Attention: Dmitry Vyukov <dvy...@google.com>
            Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
            Gerrit-Attention: Russ Cox <r...@golang.org>
            Gerrit-Comment-Date: Tue, 12 Dec 2023 22:06:49 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            It is loading more messages.
            0 new messages