This is an automated email from the ASF dual-hosted git repository.
zhangliang2022 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new dc3ef041 fix: change the filed user_id to account_id in table
pr_comments and issue_comments (#2850)
dc3ef041 is described below
commit dc3ef0419dca21ddcd5a6f97a8d081a662e9817e
Author: tsoc <[email protected]>
AuthorDate: Thu Sep 1 20:53:55 2022 +0800
fix: change the filed user_id to account_id in table pr_comments and
issue_comments (#2850)
* fix: change the filed user_id to account_id in pull_request_comment and
issue_comment
* fix: do not change models in models/migrationscripts/archived
* fix: gofmt
---
grafana/dashboards/CommunityExperience.json | 2 +-
models/domainlayer/code/pull_request_comment.go | 2 +-
models/domainlayer/ticket/issue_comment.go | 2 +-
...6_rename_columns_of_pr_comment_issue_comment.go | 27 +++++++----
models/migrationscripts/register.go | 1 +
plugins/bitbucket/e2e/comment_test.go | 4 +-
.../e2e/snapshot_tables/issue_comments.csv | 2 +-
.../e2e/snapshot_tables/pull_request_comments.csv | 2 +-
plugins/bitbucket/tasks/issue_comment_convertor.go | 2 +-
plugins/bitbucket/tasks/pr_comment_convertor.go | 2 +-
.../migrationscripts/20220829_add_init_tables.go | 4 +-
plugins/gitee/tasks/issue_comment_convertor.go | 2 +-
plugins/gitee/tasks/pr_comment_convertor.go | 2 +-
plugins/github/e2e/comment_test.go | 4 +-
.../e2e/snapshot_tables/_tool_github_issues.csv | 54 +++++++++++-----------
.../github/e2e/snapshot_tables/issue_comments.csv | 2 +-
.../e2e/snapshot_tables/pull_request_comments.csv | 2 +-
plugins/github/tasks/issue_comment_convertor.go | 2 +-
plugins/github/tasks/pr_comment_convertor.go | 2 +-
plugins/github/tasks/pr_review_convertor.go | 2 +-
plugins/gitlab/e2e/mr_notes_test.go | 2 +-
.../e2e/snapshot_tables/_tool_gitlab_mr_labels.csv | 7 ---
.../e2e/snapshot_tables/pull_request_comments.csv | 2 +-
.../e2e/snapshot_tables/pull_request_labels.csv | 7 ---
plugins/gitlab/tasks/mr_comment_convertor.go | 2 +-
25 files changed, 69 insertions(+), 73 deletions(-)
diff --git a/grafana/dashboards/CommunityExperience.json
b/grafana/dashboards/CommunityExperience.json
index 2744d8c6..f76f137c 100644
--- a/grafana/dashboards/CommunityExperience.json
+++ b/grafana/dashboards/CommunityExperience.json
@@ -426,7 +426,7 @@
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
- "rawSql": "with pr_comment_list as(\n select\n pr.id as
issue_id,\n pr.url,\n pr.title,\n pr.created_date as
pr_created_date,\n prc.id as comment_id,\n prc.created_date as
comment_date,\n prc.user_id,\n case when prc.id is not null then rank()
over (partition by pr.id order by prc.created_date asc) else null end as
comment_rank\n from\n lake.pull_requests pr\n left join
lake.pull_request_comments prc on pr.id = prc.pull_request_id\n where\n d
[...]
+ "rawSql": "with pr_comment_list as(\n select\n pr.id as
issue_id,\n pr.url,\n pr.title,\n pr.created_date as
pr_created_date,\n prc.id as comment_id,\n prc.created_date as
comment_date,\n prc.account_id,\n case when prc.id is not null then
rank() over (partition by pr.id order by prc.created_date asc) else null end as
comment_rank\n from\n lake.pull_requests pr\n left join
lake.pull_request_comments prc on pr.id = prc.pull_request_id\n where\n [...]
"refId": "A",
"select": [
[
diff --git a/models/domainlayer/code/pull_request_comment.go
b/models/domainlayer/code/pull_request_comment.go
index 78a78fb6..e7630f4b 100644
--- a/models/domainlayer/code/pull_request_comment.go
+++ b/models/domainlayer/code/pull_request_comment.go
@@ -26,7 +26,7 @@ type PullRequestComment struct {
domainlayer.DomainEntity
PullRequestId string `gorm:"index"`
Body string
- UserId string `gorm:"type:varchar(255)"`
+ AccountId string `gorm:"type:varchar(255)"`
CreatedDate time.Time
CommitSha string `gorm:"type:varchar(255)"`
Position int
diff --git a/models/domainlayer/ticket/issue_comment.go
b/models/domainlayer/ticket/issue_comment.go
index f8c8888e..a434df21 100644
--- a/models/domainlayer/ticket/issue_comment.go
+++ b/models/domainlayer/ticket/issue_comment.go
@@ -26,7 +26,7 @@ type IssueComment struct {
domainlayer.DomainEntity
IssueId string `gorm:"index"`
Body string
- UserId string `gorm:"type:varchar(255)"`
+ AccountId string `gorm:"type:varchar(255)"`
CreatedDate time.Time
}
diff --git a/plugins/dora/models/migrationscripts/20220829_add_init_tables.go
b/models/migrationscripts/20220826_rename_columns_of_pr_comment_issue_comment.go
similarity index 54%
copy from plugins/dora/models/migrationscripts/20220829_add_init_tables.go
copy to
models/migrationscripts/20220826_rename_columns_of_pr_comment_issue_comment.go
index 93a35f9e..39abae36 100644
--- a/plugins/dora/models/migrationscripts/20220829_add_init_tables.go
+++
b/models/migrationscripts/20220826_rename_columns_of_pr_comment_issue_comment.go
@@ -19,21 +19,30 @@ package migrationscripts
import (
"context"
+ "github.com/apache/incubator-devlake/models/migrationscripts/archived"
"gorm.io/gorm"
)
-type addInitTables struct {}
+type renameColumnsOfPrCommentIssueComment struct{}
-func (u *addInitTables) Up(ctx context.Context, db *gorm.DB) error {
- return db.Migrator().AutoMigrate(
- // TODO add you models
- )
+func (*renameColumnsOfPrCommentIssueComment) Up(ctx context.Context, db
*gorm.DB) error {
+
+ err := db.Migrator().RenameColumn(&archived.PullRequestComment{},
"user_id", "account_id")
+ if err != nil {
+ return err
+ }
+ err = db.Migrator().RenameColumn(&archived.IssueComment{}, "user_id",
"account_id")
+ if err != nil {
+ return err
+ }
+
+ return nil
}
-func (*addInitTables) Version() uint64 {
- return 20220829000001
+func (*renameColumnsOfPrCommentIssueComment) Version() uint64 {
+ return 20220826120824
}
-func (*addInitTables) Name() string {
- return "dora init schemas"
+func (*renameColumnsOfPrCommentIssueComment) Name() string {
+ return "rename user_id to account_id in pull_request_comments and
issue_comments"
}
diff --git a/models/migrationscripts/register.go
b/models/migrationscripts/register.go
index f6cd0a20..f2285a6d 100644
--- a/models/migrationscripts/register.go
+++ b/models/migrationscripts/register.go
@@ -36,6 +36,7 @@ func All() []migration.Script {
new(addNoPKModelToCommitParent),
new(addSubtasksTable),
new(addCICD),
+ new(renameColumnsOfPrCommentIssueComment),
new(modifyTablesForDora),
}
}
diff --git a/plugins/bitbucket/e2e/comment_test.go
b/plugins/bitbucket/e2e/comment_test.go
index c6a45935..5ab92279 100644
--- a/plugins/bitbucket/e2e/comment_test.go
+++ b/plugins/bitbucket/e2e/comment_test.go
@@ -140,7 +140,7 @@ func TestCommentDataFlow(t *testing.T) {
"_raw_data_remark",
"issue_id",
"body",
- "user_id",
+ "account_id",
},
)
@@ -158,7 +158,7 @@ func TestCommentDataFlow(t *testing.T) {
"_raw_data_remark",
"pull_request_id",
"body",
- "user_id",
+ "account_id",
"commit_sha",
"position",
"type",
diff --git a/plugins/bitbucket/e2e/snapshot_tables/issue_comments.csv
b/plugins/bitbucket/e2e/snapshot_tables/issue_comments.csv
index c2090b12..d1769378 100644
--- a/plugins/bitbucket/e2e/snapshot_tables/issue_comments.csv
+++ b/plugins/bitbucket/e2e/snapshot_tables/issue_comments.csv
@@ -1,4 +1,4 @@
-id,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark,issue_id,body,user_id
+id,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark,issue_id,body,account_id
bitbucket:BitbucketIssue:1:63860152,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_bitbucket_api_issue_comments,1,,bitbucket:BitbucketIssue:1:1,,bitbucket:BitbucketAccount:1:62abf394192edb006fa0e8cf
bitbucket:BitbucketIssue:1:63860153,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_bitbucket_api_issue_comments,2,,bitbucket:BitbucketIssue:1:1,this
is a comment test for
issue,bitbucket:BitbucketAccount:1:62abf394192edb006fa0e8cf
bitbucket:BitbucketIssue:1:63860241,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_bitbucket_api_issue_comments,3,,bitbucket:BitbucketIssue:1:1,,bitbucket:BitbucketAccount:1:62abf394192edb006fa0e8cf
diff --git a/plugins/bitbucket/e2e/snapshot_tables/pull_request_comments.csv
b/plugins/bitbucket/e2e/snapshot_tables/pull_request_comments.csv
index ae71f7c1..6b47a4a5 100644
--- a/plugins/bitbucket/e2e/snapshot_tables/pull_request_comments.csv
+++ b/plugins/bitbucket/e2e/snapshot_tables/pull_request_comments.csv
@@ -1,4 +1,4 @@
-id,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark,pull_request_id,body,user_id,commit_sha,position,type,review_id,status
+id,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark,pull_request_id,body,account_id,commit_sha,position,type,review_id,status
bitbucket:BitbucketPrComment:1:323119643,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_bitbucket_api_pull_request_comments,14,,bitbucket:BitbucketPullRequest:1:54,this
is
test014,bitbucket:BitbucketAccount:1:62abf394192edb006fa0e8cf,,0,pullrequest_comment,,
bitbucket:BitbucketPrComment:1:323119662,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_bitbucket_api_pull_request_comments,15,,bitbucket:BitbucketPullRequest:1:54,feafjae,bitbucket:BitbucketAccount:1:62abf394192edb006fa0e8cf,,0,pullrequest_comment,,
bitbucket:BitbucketPrComment:1:323119730,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_bitbucket_api_pull_request_comments,17,,bitbucket:BitbucketPullRequest:1:57,"fejoiafjoej
diff --git a/plugins/bitbucket/tasks/issue_comment_convertor.go
b/plugins/bitbucket/tasks/issue_comment_convertor.go
index 2b8e2651..7fa2f00d 100644
--- a/plugins/bitbucket/tasks/issue_comment_convertor.go
+++ b/plugins/bitbucket/tasks/issue_comment_convertor.go
@@ -75,7 +75,7 @@ func ConvertIssueComments(taskCtx core.SubTaskContext) error {
Id:
issueIdGen.Generate(data.Options.ConnectionId,
bitbucketIssueComment.BitbucketId),
},
IssueId:
issueIdGen.Generate(data.Options.ConnectionId, bitbucketIssueComment.IssueId),
- UserId:
accountIdGen.Generate(data.Options.ConnectionId,
bitbucketIssueComment.AuthorId),
+ AccountId:
accountIdGen.Generate(data.Options.ConnectionId,
bitbucketIssueComment.AuthorId),
CreatedDate: bitbucketIssueComment.CreatedAt,
Body: bitbucketIssueComment.Body,
}
diff --git a/plugins/bitbucket/tasks/pr_comment_convertor.go
b/plugins/bitbucket/tasks/pr_comment_convertor.go
index 230810c0..26681e82 100644
--- a/plugins/bitbucket/tasks/pr_comment_convertor.go
+++ b/plugins/bitbucket/tasks/pr_comment_convertor.go
@@ -76,7 +76,7 @@ func ConvertPullRequestComments(taskCtx core.SubTaskContext)
error {
Id:
domainIdGeneratorComment.Generate(data.Options.ConnectionId,
bitbucketPullRequestComment.BitbucketId),
},
PullRequestId:
prIdGen.Generate(data.Options.ConnectionId,
bitbucketPullRequestComment.PullRequestId),
- UserId:
accountIdGen.Generate(data.Options.ConnectionId,
bitbucketPullRequestComment.AuthorId),
+ AccountId:
accountIdGen.Generate(data.Options.ConnectionId,
bitbucketPullRequestComment.AuthorId),
CreatedDate:
bitbucketPullRequestComment.CreatedAt,
Body: bitbucketPullRequestComment.Body,
Type: bitbucketPullRequestComment.Type,
diff --git a/plugins/dora/models/migrationscripts/20220829_add_init_tables.go
b/plugins/dora/models/migrationscripts/20220829_add_init_tables.go
index 93a35f9e..77aa53fe 100644
--- a/plugins/dora/models/migrationscripts/20220829_add_init_tables.go
+++ b/plugins/dora/models/migrationscripts/20220829_add_init_tables.go
@@ -22,11 +22,11 @@ import (
"gorm.io/gorm"
)
-type addInitTables struct {}
+type addInitTables struct{}
func (u *addInitTables) Up(ctx context.Context, db *gorm.DB) error {
return db.Migrator().AutoMigrate(
- // TODO add you models
+ // TODO add you models
)
}
diff --git a/plugins/gitee/tasks/issue_comment_convertor.go
b/plugins/gitee/tasks/issue_comment_convertor.go
index 8226008c..9e1c5204 100644
--- a/plugins/gitee/tasks/issue_comment_convertor.go
+++ b/plugins/gitee/tasks/issue_comment_convertor.go
@@ -69,7 +69,7 @@ func ConvertIssueComments(taskCtx core.SubTaskContext) error {
},
IssueId:
issueIdGen.Generate(data.Options.ConnectionId, giteeIssueComment.IssueId),
Body: giteeIssueComment.Body,
- UserId:
accountIdGen.Generate(data.Options.ConnectionId,
giteeIssueComment.AuthorUserId),
+ AccountId:
accountIdGen.Generate(data.Options.ConnectionId,
giteeIssueComment.AuthorUserId),
CreatedDate: giteeIssueComment.GiteeCreatedAt,
}
return []interface{}{
diff --git a/plugins/gitee/tasks/pr_comment_convertor.go
b/plugins/gitee/tasks/pr_comment_convertor.go
index ca8352d8..0a77ed31 100644
--- a/plugins/gitee/tasks/pr_comment_convertor.go
+++ b/plugins/gitee/tasks/pr_comment_convertor.go
@@ -69,7 +69,7 @@ func ConvertPullRequestComments(taskCtx core.SubTaskContext)
error {
},
PullRequestId:
prIdGen.Generate(data.Options.ConnectionId,
giteePullRequestComment.PullRequestId),
Body: giteePullRequestComment.Body,
- UserId:
accountIdGen.Generate(data.Options.ConnectionId,
giteePullRequestComment.AuthorUserId),
+ AccountId:
accountIdGen.Generate(data.Options.ConnectionId,
giteePullRequestComment.AuthorUserId),
CreatedDate:
giteePullRequestComment.GiteeCreatedAt,
CommitSha: "",
Position: 0,
diff --git a/plugins/github/e2e/comment_test.go
b/plugins/github/e2e/comment_test.go
index c9257d09..aaa18715 100644
--- a/plugins/github/e2e/comment_test.go
+++ b/plugins/github/e2e/comment_test.go
@@ -130,7 +130,7 @@ func TestCommentDataFlow(t *testing.T) {
"id",
"issue_id",
"body",
- "user_id",
+ "account_id",
"created_date",
},
)
@@ -149,7 +149,7 @@ func TestCommentDataFlow(t *testing.T) {
"_raw_data_remark",
"pull_request_id",
"body",
- "user_id",
+ "account_id",
"created_date",
"commit_sha",
"position",
diff --git a/plugins/github/e2e/snapshot_tables/_tool_github_issues.csv
b/plugins/github/e2e/snapshot_tables/_tool_github_issues.csv
index 071ad042..91bc57b1 100644
--- a/plugins/github/e2e/snapshot_tables/_tool_github_issues.csv
+++ b/plugins/github/e2e/snapshot_tables/_tool_github_issues.csv
@@ -1,27 +1,27 @@
-connection_id,github_id,repo_id,milestone_id,number,state,title,body,priority,type,status,author_id,author_name,assignee_id,assignee_name,lead_time_minutes,url,closed_at,github_created_at,github_updated_at,severity,component,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark
-1,346842831,134018330,7856149,5,closed,关于 <-p.freeSignal 的疑惑,"""Hi,\r\n
我阅读了源码,对 `<-p.freeSignal` 这句代码有疑惑。 这句代码出现在了多个地方,freeSignal 的作用英文注释我是理解的,并且知道在
`putWorker` 中才进行 `p.freeSignal <- sig{}`\r\n\r\n对于下面的代码\r\n```\r\nfunc (p
*Pool) getWorker() *Worker {\r\n\tvar w *Worker\r\n\twaiting :=
false\r\n\r\n\tp.lock.Lock()\r\n\tidleWorkers := p.workers\r\n\tn :=
len(idleWorkers) - 1\r\n\tif n < 0 { // 说明 pool中没有worker了\r\n\t\twaiting =
p.Running() >= p.Cap()\r\n\t} else { // 说明pool中有worker\r\ [...]
-1,347255859,134018330,7856149,6,closed,死锁bug,"""func (p *Pool) getWorker()
*Worker 这个函数的 199行 \r\n必须先解锁在加锁,
要不然会产生死锁\r\n\r\n\tp.lock.Unlock()\r\n\t\t<-p.freeSignal\r\n\t\tp.lock.Lock()""",,BUG,,13118848,lovelly,0,,1786,https://github.com/panjf2000/ants/issues/6,2018-08-04T10:18:41.000+00:00,2018-08-03T04:32:28.000+00:00,2018-08-04T10:18:41.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,12,
-1,348630179,134018330,7856149,7,closed,清理过期协程报错,"""你好,非常感谢提供这么好用的工具包。我在使用ants时,发现报异常。结果见下图\r\n\r\n日志是我在periodicallyPurge里加的调试信息\r\n\r\n\r\n###
原因分析\r\n\r\n我认为可能原因是没有处理n==0的情况\r\n```\r\nif n > 0 {\r\n\tn++\r\n\tp.workers =
idleWorkers[n:]\r\n}\r\n```\r\n\r\n\r\n### 测试代码\r\n` [...]
-1,356703393,134018330,7856149,10,closed,高并发下设定较小的worker数量问题,"""会存在cpu飚升的问题吧?""",,,,11763614,Moonlight-Zhao,0,,36198,https://github.com/panjf2000/ants/issues/10,2018-09-29T11:45:00.000+00:00,2018-09-04T08:26:55.000+00:00,2018-09-29T11:45:00.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,16,
-1,364361014,134018330,7856149,12,closed,潘少,更新下tag吧,"""鄙人现在在弄dep依赖管理,有用到你写的ants项目,可是你好像忘记打最新的tag了。最新的tag
3.6是指向ed55924这个提交,git上的最新代码是af376f1b这次提交,两次提交都隔了快5个月了,看到的话,麻烦打一个最新的tag吧。(手动可怜)""",,,,29452204,edcismybrother,0,,1293,https://github.com/panjf2000/ants/issues/12,2018-09-28T06:05:58.000+00:00,2018-09-27T08:32:25.000+00:00,2019-04-21T08:19:58.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,18,
-1,381941219,134018330,7856149,17,closed,关于优雅退出的问题,"""关于这个package优雅退出的问题,我看了一下Release的代码:\r\n\r\n`\r\n\t//
Release Closed this pool.\r\n\tfunc (p *PoolWithFunc) Release() error
{\r\n\t\tp.once.Do(func() {\r\n\t\t\tp.release <-
sig{}\r\n\t\t\tp.lock.Lock()\r\n\t\t\tidleWorkers := p.workers\r\n\t\t\tfor i,
w := range idleWorkers {\r\n\t\t\t\tw.args <- nil\r\n\t\t\t\tidleWorkers[i] =
nil\r\n\t\t\t}\r\n\t\t\tp.workers =
nil\r\n\t\t\tp.lock.Unlock()\r\n\t\t})\r\n\t\treturn nil\r\n\t}\r\n`\r\n\ [...]
-1,382039050,134018330,7856149,18,closed,go协程的理解,"""你好楼主,向您请教一个协程和线程的问题,协程基于go进程调度,线程基于系统内核调度,调度协程的过程是先调度线程后获得资源再去调度协程。\""官方解释:
GOMAXPROCS sets the maximum number of CPUs that can be executing
simultaneously。限制cpu数,本质上是什么,限制并行数?,并行数即同时执行数量?,执行单元即线程?,即限制最大并行线程数量?\""""",,,,13944100,LinuxForYQH,0,,20213,https://github.com/panjf2000/ants/issues/18,2018-12-03T03:53:50.000+00:00,2018-11-19T02:59:53.000+00:00,2018-12-03T03:53:50.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":"
[...]
-1,382574800,134018330,7856149,20,closed,是否考虑任务支持回调函数处理失败的逻辑和任务依赖,"""#""",,,,5668717,kklinan,0,,95398,https://github.com/panjf2000/ants/issues/20,2019-01-25T15:34:03.000+00:00,2018-11-20T09:36:02.000+00:00,2019-01-25T15:34:03.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,26,
-1,388907811,134018330,7856149,21,closed,Benchmark 下直接使用 Semaphore
似乎更快呢?,"""简单跑了一下 benchmark,Semaphore 更快且很简单\r\n\r\n```bash\r\n$ go test -bench
.\r\ngoos: darwin\r\ngoarch: amd64\r\npkg:
github.com/panjf2000/ants\r\nBenchmarkGoroutineWithFunc-4 \t
1\t3445631705 ns/op\r\nBenchmarkSemaphoreWithFunc-4 \t 1\t1037219073
ns/op\r\nBenchmarkAntsPoolWithFunc-4 \t 1\t1138053222
ns/op\r\nBenchmarkGoroutine-4 \t 2\t 731850771
ns/op\r\nBenchmarkSemaphore-4 [...]
-1,401277739,134018330,7856149,22,closed,是否考虑 worker 中添加 PanicHandler
?,"""比方说在创建 Pool 的时候传入一个 PanicHandler,然后在每个 worker 创建的时候 recover 之后传给
PanicHandler 处理。否则池子里如果发生 panic
会直接挂掉整个进程。""",,,,8923413,choleraehyq,0,,1174,https://github.com/panjf2000/ants/issues/22,2019-01-22T05:41:34.000+00:00,2019-01-21T10:06:56.000+00:00,2019-01-22T05:41:34.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,28,
-1,402513849,134018330,7856149,24,closed,提交任务不阻塞,"""`Pool.Submit`和`PoolWithFunc.Server`提交任务,如果没有空的worker,会一直阻塞。建议增加不阻塞的接口,当前失败时直接返回错误。""",,,,5044825,tenfyzhong,0,,300032,https://github.com/panjf2000/ants/issues/24,2019-08-20T10:56:30.000+00:00,2019-01-24T02:24:13.000+00:00,2019-08-20T10:56:30.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,30,
-1,405951301,134018330,7856149,25,closed,use example
errors,"""./antstest.go:37:14: cannot use syncCalculateSum (type func()) as
type ants.f in argument to ants.Submit\r\n./antstest.go:45:35: cannot use func
literal (type func(interface {})) as type ants.pf in argument to
ants.NewPoolWithFunc\r\n""",,,,5244267,jiashiwen,0,,3088,https://github.com/panjf2000/ants/issues/25,2019-02-04T09:11:52.000+00:00,2019-02-02T05:43:38.000+00:00,2019-02-04T09:11:52.000+00:00,,,"{""ConnectionId"":1,""Owne
[...]
-1,413968505,134018330,7856149,26,closed,running可能大于cap的问题,"""running与cap的比较判断与incRuning分开执行的,
可能会出现running大于cap的问题?\r\n`func (p *Pool) retrieveWorker() *Worker {\r\n\tvar w
*Worker\r\n\r\n\tp.lock.Lock()\r\n\tidleWorkers := p.workers\r\n\tn :=
len(idleWorkers) - 1\r\n\tif n >= 0 {\r\n\t\tw =
idleWorkers[n]\r\n\t\tidleWorkers[n] = nil\r\n\t\tp.workers =
idleWorkers[:n]\r\n\t\tp.lock.Unlock()\r\n\t} else if p.Running() < p.Cap()
{\r\n\t\tp.lock.Unlock()\r\n\t\tif cacheWorker := p.workerCac [...]
-1,419183961,134018330,7856149,27,closed,为何goroutine一直上不去,用户量也打不上去,"""为何goroutine一直上不去,用户量也打不上去\r\n是我用的有问题吗?\r\n\r\nwebsocket
server\r\nhttps://github.com/im-ai/pushm/blob/master/learn/goroutine/goroutinepoolwebsocket.go\r\n\r\nwebsocket
cient\r\nhttps://github.com/im-ai/pushm/blob/master/learn/goroutine/goroutinepoolwebsocketclient.go\r\n""",,,,38367404,liliang8858,0,,37496,https://github.com/panjf2000/ants/issues/27,2019-04-05T14:05:20.000+00:00,2019-03-10T13:08:52.000+00:00,2019-04-05T
[...]
-1,419268851,134018330,7856149,28,closed,cap 和 running 比较的问题,"""这是我在 Playground
上面的代码 https://play.golang.org/p/D94YUU3FnX6\r\natomic
只能保证自增自减时的原子操作,在比较过程中,其他线程对变量进行了操作 比较过程并无感知,所以这个比较结果 不是完全正确的,想要实现
比较的数量完全正确,只能在修改和比较两个值的地方加锁\r\n像 #26
说的是对的""",,,,29243953,naiba,0,,237002,https://github.com/panjf2000/ants/issues/28,2019-08-22T16:27:37.000+00:00,2019-03-11T02:24:41.000+00:00,2019-08-22T16:27:37.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,34,
-1,424634533,134018330,7856149,29,closed,任务传参,"""你好,你的项目太酷了👍\r\n\r\nhttps://github.com/panjf2000/ants/blob/master/pool.go#L124
貌似不支持带参数的任务,
请问传参是用闭包的方式吗?\r\n""",,,,8509898,prprprus,0,,999,https://github.com/panjf2000/ants/issues/29,2019-03-25T09:32:11.000+00:00,2019-03-24T16:52:21.000+00:00,2019-03-25T09:45:05.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,35,
-1,429972115,134018330,7856149,31,closed,Add
go.mod,"""""",,,,48135919,tsatke,0,,3474,https://github.com/panjf2000/ants/issues/31,2019-04-08T09:45:31.000+00:00,2019-04-05T23:50:36.000+00:00,2019-10-17T03:12:19.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,37,
-1,433564955,134018330,7856149,32,closed,关于版本问题,我发现小版本(0.0.x)这种更新就会不向下兼容?,"""如题,我感觉这样不好。\r\n\r\n功能版本号不向下兼容能理解\r\n\r\n修复问题的版本号也不向下兼容,难以理解。""",,,,7931755,zplzpl,0,,7440,https://github.com/panjf2000/ants/issues/32,2019-04-21T07:16:26.000+00:00,2019-04-16T03:16:02.000+00:00,2019-04-21T07:16:26.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,38,
-1,434069015,134018330,7856149,33,closed,support semantic
versioning.,"""建议将发布的tag兼容为semantic versioning,vX.Y.Z。go
modules对此支持比较良好。\r\nhttps://semver.org/\r\nhttps://research.swtch.com/vgo-import""",,,,1284892,jjeffcaii,0,,6090,https://github.com/panjf2000/ants/issues/33,2019-04-21T08:25:20.000+00:00,2019-04-17T02:55:11.000+00:00,2019-04-21T08:25:20.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,39,
-1,435486645,134018330,7856149,34,closed,Important announcement about <ants>
from author !!!,"""**Dear users of `ants`:**\r\nI am apologetically telling you
that I have to dump all tags which already presents in `ants`
repository.\r\n\r\nThe reason why I'm doing so is to standardize the version
management with `Semantic Versioning`, which will make a formal and clear
dependency management in go, for go modules, godep, or glide, etc. So I decide
to start over the tag sequence, you could fi [...]
-1,461280653,134018330,7856149,35,closed,worker exit on
panic,"""个人认为PanicHandler设计不妥。\r\n1.无PanicHandler时,抛出给外面的不是panic,外层感受不到。\r\n2.无论有没有PanicHandler,都会导致worker退出,最终pool阻塞住全部任务。""",,,,38849208,king526,0,,74481,https://github.com/panjf2000/ants/issues/35,2019-08-17T20:33:10.000+00:00,2019-06-27T03:11:49.000+00:00,2019-08-17T20:33:10.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,41,
-1,462631417,134018330,7856149,37,closed,请不要再随意变更版本号了。。。,"""之前用的是
3.9.9,结果今天构建出了问题,一看发现这个版本没了,变成
1.0.0。这种变更完全不考虑现有用户的情况。希望以后不要随意变更了""",,,,8923413,choleraehyq,0,,140,https://github.com/panjf2000/ants/issues/37,2019-07-01T12:37:55.000+00:00,2019-07-01T10:17:15.000+00:00,2019-07-02T10:17:31.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,43,
-1,472125082,134018330,7856149,38,closed,retrieveWorker与revertWorker之间会导致死锁,"""func
(p *Pool) retrieveWorker() *Worker {\r\n\tvar w
*Worker\r\n\r\n\t**p.lock.Lock()**\r\n\tidleWorkers := p.workers\r\n\tn :=
len(idleWorkers) - 1\r\n\tif n >= 0 {\r\n\t\tw =
idleWorkers[n]\r\n\t\tidleWorkers[n] = nil\r\n\t\tp.workers =
idleWorkers[:n]\r\n\t\tp.lock.Unlock()\r\n\t} else if p.Running() < p.Cap()
{\r\n\t\tp.lock.Unlock()\r\n\t\tif cacheWorker := p.workerCache.Get();
cacheWorker != nil {\r\n\t\t [...]
-1,483164833,134018330,7856149,42,closed,带选项的初始化函数,我觉得用 functional options
更好一点,"""以下是示意代码\r\n如果用 functional
options,原来的写法是\r\n```\r\nants.NewPool(10)\r\n```\r\n新的写法,如果不加 option,写法是不变的,因为
options 是作为可变参数传进去的。如果要加 option,只需要改成\r\n```\r\nants.NewPool(10,
ants.WithNonblocking(true))\r\n```\r\n这样。\r\n\r\n现在是直接传一个 Option
结构体进去,所有的地方都要改,感觉很不优雅。\r\n具体 functional options 的设计可以看 rob pike 的一篇博客
https://commandcenter.blogspot.com/2014/01/self-referential-functions-and-design.html""",,,,8923413,chole
[...]
-1,483736247,134018330,7856149,43,closed,1.3.0 是不兼容更新,"""Pool
里那些暴露出来的字段(PanicHandler
之类的)都没了,这是一个不兼容更新,根据语义化版本的要求要发大版本。""",,,,8923413,choleraehyq,0,,652,https://github.com/panjf2000/ants/issues/43,2019-08-22T13:22:10.000+00:00,2019-08-22T02:29:34.000+00:00,2019-08-22T13:22:10.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,49,
-1,484311063,134018330,7856149,44,closed,1.1.1 -> 1.2.0 也是不兼容更新,"""Pool.Release
的返回值没了""",,,,8923413,choleraehyq,0,,3068,https://github.com/panjf2000/ants/issues/44,2019-08-25T06:36:14.000+00:00,2019-08-23T03:27:38.000+00:00,2019-08-25T06:36:14.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,50,
+connection_id,github_id,repo_id,number,state,title,body,priority,type,status,author_id,author_name,assignee_id,assignee_name,milestone_id,lead_time_minutes,url,closed_at,github_created_at,github_updated_at,severity,component,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark
+1,346842831,134018330,5,closed,关于 <-p.freeSignal 的疑惑,"""Hi,\r\n 我阅读了源码,对
`<-p.freeSignal` 这句代码有疑惑。 这句代码出现在了多个地方,freeSignal 的作用英文注释我是理解的,并且知道在
`putWorker` 中才进行 `p.freeSignal <- sig{}`\r\n\r\n对于下面的代码\r\n```\r\nfunc (p
*Pool) getWorker() *Worker {\r\n\tvar w *Worker\r\n\twaiting :=
false\r\n\r\n\tp.lock.Lock()\r\n\tidleWorkers := p.workers\r\n\tn :=
len(idleWorkers) - 1\r\n\tif n < 0 { // 说明 pool中没有worker了\r\n\t\twaiting =
p.Running() >= p.Cap()\r\n\t} else { // 说明pool中有worker\r\n\t\t<-p [...]
+1,347255859,134018330,6,closed,死锁bug,"""func (p *Pool) getWorker() *Worker
这个函数的 199行 \r\n必须先解锁在加锁,
要不然会产生死锁\r\n\r\n\tp.lock.Unlock()\r\n\t\t<-p.freeSignal\r\n\t\tp.lock.Lock()""",,BUG,,13118848,lovelly,0,,7856149,1786,https://github.com/panjf2000/ants/issues/6,2018-08-04T10:18:41.000+00:00,2018-08-03T04:32:28.000+00:00,2018-08-04T10:18:41.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,12,
+1,348630179,134018330,7,closed,清理过期协程报错,"""你好,非常感谢提供这么好用的工具包。我在使用ants时,发现报异常。结果见下图\r\n\r\n日志是我在periodicallyPurge里加的调试信息\r\n\r\n\r\n###
原因分析\r\n\r\n我认为可能原因是没有处理n==0的情况\r\n```\r\nif n > 0 {\r\n\tn++\r\n\tp.workers =
idleWorkers[n:]\r\n}\r\n```\r\n\r\n\r\n### 测试代码\r\n```\r\npa [...]
+1,356703393,134018330,10,closed,高并发下设定较小的worker数量问题,"""会存在cpu飚升的问题吧?""",,,,11763614,Moonlight-Zhao,0,,7856149,36198,https://github.com/panjf2000/ants/issues/10,2018-09-29T11:45:00.000+00:00,2018-09-04T08:26:55.000+00:00,2018-09-29T11:45:00.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,16,
+1,364361014,134018330,12,closed,潘少,更新下tag吧,"""鄙人现在在弄dep依赖管理,有用到你写的ants项目,可是你好像忘记打最新的tag了。最新的tag
3.6是指向ed55924这个提交,git上的最新代码是af376f1b这次提交,两次提交都隔了快5个月了,看到的话,麻烦打一个最新的tag吧。(手动可怜)""",,,,29452204,edcismybrother,0,,7856149,1293,https://github.com/panjf2000/ants/issues/12,2018-09-28T06:05:58.000+00:00,2018-09-27T08:32:25.000+00:00,2019-04-21T08:19:58.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,18,
+1,381941219,134018330,17,closed,关于优雅退出的问题,"""关于这个package优雅退出的问题,我看了一下Release的代码:\r\n\r\n`\r\n\t//
Release Closed this pool.\r\n\tfunc (p *PoolWithFunc) Release() error
{\r\n\t\tp.once.Do(func() {\r\n\t\t\tp.release <-
sig{}\r\n\t\t\tp.lock.Lock()\r\n\t\t\tidleWorkers := p.workers\r\n\t\t\tfor i,
w := range idleWorkers {\r\n\t\t\t\tw.args <- nil\r\n\t\t\t\tidleWorkers[i] =
nil\r\n\t\t\t}\r\n\t\t\tp.workers =
nil\r\n\t\t\tp.lock.Unlock()\r\n\t\t})\r\n\t\treturn
nil\r\n\t}\r\n`\r\n\r\nrelea [...]
+1,382039050,134018330,18,closed,go协程的理解,"""你好楼主,向您请教一个协程和线程的问题,协程基于go进程调度,线程基于系统内核调度,调度协程的过程是先调度线程后获得资源再去调度协程。\""官方解释:
GOMAXPROCS sets the maximum number of CPUs that can be executing
simultaneously。限制cpu数,本质上是什么,限制并行数?,并行数即同时执行数量?,执行单元即线程?,即限制最大并行线程数量?\""""",,,,13944100,LinuxForYQH,0,,7856149,20213,https://github.com/panjf2000/ants/issues/18,2018-12-03T03:53:50.000+00:00,2018-11-19T02:59:53.000+00:00,2018-12-03T03:53:50.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":"
[...]
+1,382574800,134018330,20,closed,是否考虑任务支持回调函数处理失败的逻辑和任务依赖,"""#""",,,,5668717,kklinan,0,,7856149,95398,https://github.com/panjf2000/ants/issues/20,2019-01-25T15:34:03.000+00:00,2018-11-20T09:36:02.000+00:00,2019-01-25T15:34:03.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,26,
+1,388907811,134018330,21,closed,Benchmark 下直接使用 Semaphore 似乎更快呢?,"""简单跑了一下
benchmark,Semaphore 更快且很简单\r\n\r\n```bash\r\n$ go test -bench .\r\ngoos:
darwin\r\ngoarch: amd64\r\npkg:
github.com/panjf2000/ants\r\nBenchmarkGoroutineWithFunc-4 \t
1\t3445631705 ns/op\r\nBenchmarkSemaphoreWithFunc-4 \t 1\t1037219073
ns/op\r\nBenchmarkAntsPoolWithFunc-4 \t 1\t1138053222
ns/op\r\nBenchmarkGoroutine-4 \t 2\t 731850771
ns/op\r\nBenchmarkSemaphore-4 [...]
+1,401277739,134018330,22,closed,是否考虑 worker 中添加 PanicHandler ?,"""比方说在创建 Pool
的时候传入一个 PanicHandler,然后在每个 worker 创建的时候 recover 之后传给 PanicHandler 处理。否则池子里如果发生
panic
会直接挂掉整个进程。""",,,,8923413,choleraehyq,0,,7856149,1174,https://github.com/panjf2000/ants/issues/22,2019-01-22T05:41:34.000+00:00,2019-01-21T10:06:56.000+00:00,2019-01-22T05:41:34.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,28,
+1,402513849,134018330,24,closed,提交任务不阻塞,"""`Pool.Submit`和`PoolWithFunc.Server`提交任务,如果没有空的worker,会一直阻塞。建议增加不阻塞的接口,当前失败时直接返回错误。""",,,,5044825,tenfyzhong,0,,7856149,300032,https://github.com/panjf2000/ants/issues/24,2019-08-20T10:56:30.000+00:00,2019-01-24T02:24:13.000+00:00,2019-08-20T10:56:30.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,30,
+1,405951301,134018330,25,closed,use example errors,"""./antstest.go:37:14:
cannot use syncCalculateSum (type func()) as type ants.f in argument to
ants.Submit\r\n./antstest.go:45:35: cannot use func literal (type
func(interface {})) as type ants.pf in argument to
ants.NewPoolWithFunc\r\n""",,,,5244267,jiashiwen,0,,7856149,3088,https://github.com/panjf2000/ants/issues/25,2019-02-04T09:11:52.000+00:00,2019-02-02T05:43:38.000+00:00,2019-02-04T09:11:52.000+00:00,,,"{""ConnectionId"":1,""Owne
[...]
+1,413968505,134018330,26,closed,running可能大于cap的问题,"""running与cap的比较判断与incRuning分开执行的,
可能会出现running大于cap的问题?\r\n`func (p *Pool) retrieveWorker() *Worker {\r\n\tvar w
*Worker\r\n\r\n\tp.lock.Lock()\r\n\tidleWorkers := p.workers\r\n\tn :=
len(idleWorkers) - 1\r\n\tif n >= 0 {\r\n\t\tw =
idleWorkers[n]\r\n\t\tidleWorkers[n] = nil\r\n\t\tp.workers =
idleWorkers[:n]\r\n\t\tp.lock.Unlock()\r\n\t} else if p.Running() < p.Cap()
{\r\n\t\tp.lock.Unlock()\r\n\t\tif cacheWorker := p.workerCache.Get() [...]
+1,419183961,134018330,27,closed,为何goroutine一直上不去,用户量也打不上去,"""为何goroutine一直上不去,用户量也打不上去\r\n是我用的有问题吗?\r\n\r\nwebsocket
server\r\nhttps://github.com/im-ai/pushm/blob/master/learn/goroutine/goroutinepoolwebsocket.go\r\n\r\nwebsocket
cient\r\nhttps://github.com/im-ai/pushm/blob/master/learn/goroutine/goroutinepoolwebsocketclient.go\r\n""",,,,38367404,liliang8858,0,,7856149,37496,https://github.com/panjf2000/ants/issues/27,2019-04-05T14:05:20.000+00:00,2019-03-10T13:08:52.000+00:00,2019-04-05T
[...]
+1,419268851,134018330,28,closed,cap 和 running 比较的问题,"""这是我在 Playground 上面的代码
https://play.golang.org/p/D94YUU3FnX6\r\natomic
只能保证自增自减时的原子操作,在比较过程中,其他线程对变量进行了操作 比较过程并无感知,所以这个比较结果 不是完全正确的,想要实现
比较的数量完全正确,只能在修改和比较两个值的地方加锁\r\n像 #26
说的是对的""",,,,29243953,naiba,0,,7856149,237002,https://github.com/panjf2000/ants/issues/28,2019-08-22T16:27:37.000+00:00,2019-03-11T02:24:41.000+00:00,2019-08-22T16:27:37.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,34,
+1,424634533,134018330,29,closed,任务传参,"""你好,你的项目太酷了👍\r\n\r\nhttps://github.com/panjf2000/ants/blob/master/pool.go#L124
貌似不支持带参数的任务,
请问传参是用闭包的方式吗?\r\n""",,,,8509898,prprprus,0,,7856149,999,https://github.com/panjf2000/ants/issues/29,2019-03-25T09:32:11.000+00:00,2019-03-24T16:52:21.000+00:00,2019-03-25T09:45:05.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,35,
+1,429972115,134018330,31,closed,Add
go.mod,"""""",,,,48135919,tsatke,0,,7856149,3474,https://github.com/panjf2000/ants/issues/31,2019-04-08T09:45:31.000+00:00,2019-04-05T23:50:36.000+00:00,2019-10-17T03:12:19.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,37,
+1,433564955,134018330,32,closed,关于版本问题,我发现小版本(0.0.x)这种更新就会不向下兼容?,"""如题,我感觉这样不好。\r\n\r\n功能版本号不向下兼容能理解\r\n\r\n修复问题的版本号也不向下兼容,难以理解。""",,,,7931755,zplzpl,0,,7856149,7440,https://github.com/panjf2000/ants/issues/32,2019-04-21T07:16:26.000+00:00,2019-04-16T03:16:02.000+00:00,2019-04-21T07:16:26.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,38,
+1,434069015,134018330,33,closed,support semantic
versioning.,"""建议将发布的tag兼容为semantic versioning,vX.Y.Z。go
modules对此支持比较良好。\r\nhttps://semver.org/\r\nhttps://research.swtch.com/vgo-import""",,,,1284892,jjeffcaii,0,,7856149,6090,https://github.com/panjf2000/ants/issues/33,2019-04-21T08:25:20.000+00:00,2019-04-17T02:55:11.000+00:00,2019-04-21T08:25:20.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,39,
+1,435486645,134018330,34,closed,Important announcement about <ants> from
author !!!,"""**Dear users of `ants`:**\r\nI am apologetically telling you that
I have to dump all tags which already presents in `ants` repository.\r\n\r\nThe
reason why I'm doing so is to standardize the version management with `Semantic
Versioning`, which will make a formal and clear dependency management in go,
for go modules, godep, or glide, etc. So I decide to start over the tag
sequence, you could find more [...]
+1,461280653,134018330,35,closed,worker exit on
panic,"""个人认为PanicHandler设计不妥。\r\n1.无PanicHandler时,抛出给外面的不是panic,外层感受不到。\r\n2.无论有没有PanicHandler,都会导致worker退出,最终pool阻塞住全部任务。""",,,,38849208,king526,0,,7856149,74481,https://github.com/panjf2000/ants/issues/35,2019-08-17T20:33:10.000+00:00,2019-06-27T03:11:49.000+00:00,2019-08-17T20:33:10.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,41,
+1,462631417,134018330,37,closed,请不要再随意变更版本号了。。。,"""之前用的是
3.9.9,结果今天构建出了问题,一看发现这个版本没了,变成
1.0.0。这种变更完全不考虑现有用户的情况。希望以后不要随意变更了""",,,,8923413,choleraehyq,0,,7856149,140,https://github.com/panjf2000/ants/issues/37,2019-07-01T12:37:55.000+00:00,2019-07-01T10:17:15.000+00:00,2019-07-02T10:17:31.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,43,
+1,472125082,134018330,38,closed,retrieveWorker与revertWorker之间会导致死锁,"""func (p
*Pool) retrieveWorker() *Worker {\r\n\tvar w
*Worker\r\n\r\n\t**p.lock.Lock()**\r\n\tidleWorkers := p.workers\r\n\tn :=
len(idleWorkers) - 1\r\n\tif n >= 0 {\r\n\t\tw =
idleWorkers[n]\r\n\t\tidleWorkers[n] = nil\r\n\t\tp.workers =
idleWorkers[:n]\r\n\t\tp.lock.Unlock()\r\n\t} else if p.Running() < p.Cap()
{\r\n\t\tp.lock.Unlock()\r\n\t\tif cacheWorker := p.workerCache.Get();
cacheWorker != nil {\r\n\t\t\tw = ca [...]
+1,483164833,134018330,42,closed,带选项的初始化函数,我觉得用 functional options
更好一点,"""以下是示意代码\r\n如果用 functional
options,原来的写法是\r\n```\r\nants.NewPool(10)\r\n```\r\n新的写法,如果不加 option,写法是不变的,因为
options 是作为可变参数传进去的。如果要加 option,只需要改成\r\n```\r\nants.NewPool(10,
ants.WithNonblocking(true))\r\n```\r\n这样。\r\n\r\n现在是直接传一个 Option
结构体进去,所有的地方都要改,感觉很不优雅。\r\n具体 functional options 的设计可以看 rob pike 的一篇博客
https://commandcenter.blogspot.com/2014/01/self-referential-functions-and-design.html""",,,,8923413,choleraehyq,0
[...]
+1,483736247,134018330,43,closed,1.3.0 是不兼容更新,"""Pool 里那些暴露出来的字段(PanicHandler
之类的)都没了,这是一个不兼容更新,根据语义化版本的要求要发大版本。""",,,,8923413,choleraehyq,0,,7856149,652,https://github.com/panjf2000/ants/issues/43,2019-08-22T13:22:10.000+00:00,2019-08-22T02:29:34.000+00:00,2019-08-22T13:22:10.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,49,
+1,484311063,134018330,44,closed,1.1.1 -> 1.2.0 也是不兼容更新,"""Pool.Release
的返回值没了""",,,,8923413,choleraehyq,0,,7856149,3068,https://github.com/panjf2000/ants/issues/44,2019-08-25T06:36:14.000+00:00,2019-08-23T03:27:38.000+00:00,2019-08-25T06:36:14.000+00:00,,,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_issues,50,
diff --git a/plugins/github/e2e/snapshot_tables/issue_comments.csv
b/plugins/github/e2e/snapshot_tables/issue_comments.csv
index 703c1f85..c1e2ff06 100644
--- a/plugins/github/e2e/snapshot_tables/issue_comments.csv
+++ b/plugins/github/e2e/snapshot_tables/issue_comments.csv
@@ -1,4 +1,4 @@
-id,issue_id,body,user_id,created_date
+id,issue_id,body,account_id,created_date
github:GithubIssue:1:409800144,github:GithubIssue:1:346842831,"""这里freeSignal和idleWorkers的数量是绝对匹配的,也就是说,只要freeSignal有值那么idleWorkers里肯定有可用worker可以取出来,putWorker就是把可用worker放回idleWorkers,每次都会塞一个值进freeSignal,还有每次从idleWorkers里取一个worker都要取出freeSignal对应的一个值,不存在有可用worker却被freeSignal阻塞""",github:GithubAccount:1:7496278,2018-08-02T04:13:09.000+00:00
github:GithubIssue:1:410141732,github:GithubIssue:1:347255859,"""切片如下\r\n\r\n这里等待锁\r\n9913
@ 0x42c73a 0x42c7ee 0x43cf64 0x43cc7d 0x46dfe8 0x7b28e0 0x7b2be5
0x4591f1\r\n#\t0x43cc7c\tsync.runtime_SemacquireMutex+0x3c\t\t\t\tE:/go/src/runtime/sema.go:71\r\n#\t0x46dfe7\tsync.(*Mutex).Lock+0x107\t\t\t\t\tE:/go/src/sync/mutex.go:134\r\n#\t0x7b28df\tmp/vendor/github.com/panjf2000/ants.(*Pool).putWorker+0x6f\tF:/gowork/src/mp/vendor/github.com/panjf2000/ants/pool.go:229\r\n#\t0x7b2be4\tmp/vendor
[...]
github:GithubIssue:1:410143221,github:GithubIssue:1:347255859,"""加了锁之后有下标溢出了。。。\r\npanic:
runtime error: index out of range\r\n\r\ngoroutine 7
[running]:\r\nmp/vendor/github.com/panjf2000/ants.(*Pool).getWorker(0xc4200b6460,
0xc4202a6e01)\r\n\tF:/gowork/src/mp/vendor/github.com/panjf2000/ants/pool.go:213
+0x2ce\r\nmp/vendor/github.com/panjf2000/ants.(*Pool).Submit(0xc4200b6460,
0xc4223d47d0, 0x0,
0x0)\r\n\tF:/gowork/src/mp/vendor/github.com/panjf2000/ants/pool.go:125
+0x62\r\n""",github: [...]
diff --git a/plugins/github/e2e/snapshot_tables/pull_request_comments.csv
b/plugins/github/e2e/snapshot_tables/pull_request_comments.csv
index a0b392b8..8b272bfa 100644
--- a/plugins/github/e2e/snapshot_tables/pull_request_comments.csv
+++ b/plugins/github/e2e/snapshot_tables/pull_request_comments.csv
@@ -1,4 +1,4 @@
-id,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark,pull_request_id,body,user_id,created_date,commit_sha,position,type,review_id,status
+id,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark,pull_request_id,body,account_id,created_date,commit_sha,position,type,review_id,status
github:GithubPrComment:1:300245643,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,1,,github:GithubPullRequest:1:292246524,"""这里我不太明白,这么写能让这个goroutine不结束?""",github:GithubAccount:1:7496278,2019-07-04T06:32:11.000+00:00,39f04c6e65b76b5f20abd3ca0606db4cd038e5c2,0,DIFF,github:GithubPrReview:1:257849164,
github:GithubPrComment:1:300246398,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,2,,github:GithubPullRequest:1:292246524,"""`f()`应该放到这个匿名函数里面吧?""",github:GithubAccount:1:7496278,2019-07-04T06:35:07.000+00:00,39f04c6e65b76b5f20abd3ca0606db4cd038e5c2,0,DIFF,github:GithubPrReview:1:257849164,
github:GithubPrComment:1:307667007,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,3,,github:GithubPullRequest:1:301421607,"""I
don't think assigning this variable to a oversize value is a good idea, threre
are different scenarios which should have different interval durations to clean
up goroutines, so could you please make `DEFAULT_CLEAN_INTERVAL_TIME `
configurable? Maybe adding a new function that accepts this variable as [...]
diff --git a/plugins/github/tasks/issue_comment_convertor.go
b/plugins/github/tasks/issue_comment_convertor.go
index cab24553..b63f42de 100644
--- a/plugins/github/tasks/issue_comment_convertor.go
+++ b/plugins/github/tasks/issue_comment_convertor.go
@@ -76,7 +76,7 @@ func ConvertIssueComments(taskCtx core.SubTaskContext) error {
},
IssueId:
issueIdGen.Generate(data.Options.ConnectionId, githubIssueComment.IssueId),
Body: githubIssueComment.Body,
- UserId:
accountIdGen.Generate(data.Options.ConnectionId,
githubIssueComment.AuthorUserId),
+ AccountId:
accountIdGen.Generate(data.Options.ConnectionId,
githubIssueComment.AuthorUserId),
CreatedDate: githubIssueComment.GithubCreatedAt,
}
return []interface{}{
diff --git a/plugins/github/tasks/pr_comment_convertor.go
b/plugins/github/tasks/pr_comment_convertor.go
index 731c1bda..8fffb695 100644
--- a/plugins/github/tasks/pr_comment_convertor.go
+++ b/plugins/github/tasks/pr_comment_convertor.go
@@ -77,7 +77,7 @@ func ConvertPullRequestComments(taskCtx core.SubTaskContext)
error {
},
PullRequestId:
prIdGen.Generate(data.Options.ConnectionId,
githubPullRequestComment.PullRequestId),
Body: githubPullRequestComment.Body,
- UserId:
accountIdGen.Generate(data.Options.ConnectionId,
githubPullRequestComment.AuthorUserId),
+ AccountId:
accountIdGen.Generate(data.Options.ConnectionId,
githubPullRequestComment.AuthorUserId),
CreatedDate:
githubPullRequestComment.GithubCreatedAt,
CommitSha:
githubPullRequestComment.CommitSha,
ReviewId:
prReviewIdGen.Generate(data.Options.ConnectionId,
githubPullRequestComment.ReviewId),
diff --git a/plugins/github/tasks/pr_review_convertor.go
b/plugins/github/tasks/pr_review_convertor.go
index 3aa5c8e0..09442c13 100644
--- a/plugins/github/tasks/pr_review_convertor.go
+++ b/plugins/github/tasks/pr_review_convertor.go
@@ -77,7 +77,7 @@ func ConvertPullRequestReviews(taskCtx core.SubTaskContext)
error {
},
PullRequestId:
prIdGen.Generate(data.Options.ConnectionId,
githubPullRequestReview.PullRequestId),
Body: githubPullRequestReview.Body,
- UserId:
accountIdGen.Generate(data.Options.ConnectionId,
githubPullRequestReview.AuthorUserId),
+ AccountId:
accountIdGen.Generate(data.Options.ConnectionId,
githubPullRequestReview.AuthorUserId),
CommitSha:
githubPullRequestReview.CommitSha,
Type: "REVIEW",
Status: githubPullRequestReview.State,
diff --git a/plugins/gitlab/e2e/mr_notes_test.go
b/plugins/gitlab/e2e/mr_notes_test.go
index e00e93c2..e13c05c5 100644
--- a/plugins/gitlab/e2e/mr_notes_test.go
+++ b/plugins/gitlab/e2e/mr_notes_test.go
@@ -144,7 +144,7 @@ func TestGitlabMrNoteDataFlow(t *testing.T) {
"id",
"pull_request_id",
"body",
- "user_id",
+ "account_id",
"created_date",
"commit_sha",
"position",
diff --git a/plugins/gitlab/e2e/snapshot_tables/_tool_gitlab_mr_labels.csv
b/plugins/gitlab/e2e/snapshot_tables/_tool_gitlab_mr_labels.csv
index f2861260..95a3789a 100644
--- a/plugins/gitlab/e2e/snapshot_tables/_tool_gitlab_mr_labels.csv
+++ b/plugins/gitlab/e2e/snapshot_tables/_tool_gitlab_mr_labels.csv
@@ -1,15 +1,8 @@
connection_id,mr_id,label_name,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark
-1,34300715,Data
Team,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,2,
-1,34300715,dbt,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,2,
-1,34300715,Enhancement,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,2,
-1,34300715,Snowflake,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,2,
1,35841926,Analytics,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,4,
1,35841926,Data
Team,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,4,
1,35841926,dbt,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,4,
1,35841926,Refactor,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,4,
-1,53640548,Data
Team,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,7,
-1,53640548,Refactor,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,7,
-1,53640548,Snowflake,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,7,
1,55146687,Analytics,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,8,
1,55146687,Data
Team,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,8,
1,55146687,dbt,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,8,
diff --git a/plugins/gitlab/e2e/snapshot_tables/pull_request_comments.csv
b/plugins/gitlab/e2e/snapshot_tables/pull_request_comments.csv
index a6258d0c..aab3a9b7 100644
--- a/plugins/gitlab/e2e/snapshot_tables/pull_request_comments.csv
+++ b/plugins/gitlab/e2e/snapshot_tables/pull_request_comments.csv
@@ -1,4 +1,4 @@
-id,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark,pull_request_id,body,user_id,created_date,commit_sha,position
+id,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark,pull_request_id,body,account_id,created_date,commit_sha,position
gitlab:GitlabMrComment:1:135100359,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_request_notes,71,,gitlab:GitlabMergeRequest:1:1149942101,approved
this merge
request,gitlab:GitlabAccount:1:3393147,2019-01-25T16:46:23.996+00:00,,0
gitlab:GitlabMrComment:1:135223089,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_request_notes,126,,gitlab:GitlabMergeRequest:1:135772105,approved
this merge
request,gitlab:GitlabAccount:1:3393147,2019-01-26T11:41:34.158+00:00,,0
gitlab:GitlabMrComment:1:135848627,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_request_notes,169,,gitlab:GitlabMergeRequest:1:15869219,approved
this merge
request,gitlab:GitlabAccount:1:2436773,2019-01-29T00:40:37.158+00:00,,0
diff --git a/plugins/gitlab/e2e/snapshot_tables/pull_request_labels.csv
b/plugins/gitlab/e2e/snapshot_tables/pull_request_labels.csv
index 33e37101..0817b55e 100644
--- a/plugins/gitlab/e2e/snapshot_tables/pull_request_labels.csv
+++ b/plugins/gitlab/e2e/snapshot_tables/pull_request_labels.csv
@@ -1,15 +1,8 @@
pull_request_id,label_name,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark
-gitlab:GitlabMergeRequest:1:34300715,Data
Team,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,2,
-gitlab:GitlabMergeRequest:1:34300715,dbt,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,2,
-gitlab:GitlabMergeRequest:1:34300715,Enhancement,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,2,
-gitlab:GitlabMergeRequest:1:34300715,Snowflake,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,2,
gitlab:GitlabMergeRequest:1:35841926,Analytics,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,4,
gitlab:GitlabMergeRequest:1:35841926,Data
Team,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,4,
gitlab:GitlabMergeRequest:1:35841926,dbt,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,4,
gitlab:GitlabMergeRequest:1:35841926,Refactor,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,4,
-gitlab:GitlabMergeRequest:1:53640548,Data
Team,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,7,
-gitlab:GitlabMergeRequest:1:53640548,Refactor,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,7,
-gitlab:GitlabMergeRequest:1:53640548,Snowflake,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,7,
gitlab:GitlabMergeRequest:1:55146687,Analytics,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,8,
gitlab:GitlabMergeRequest:1:55146687,Data
Team,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,8,
gitlab:GitlabMergeRequest:1:55146687,dbt,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,8,
diff --git a/plugins/gitlab/tasks/mr_comment_convertor.go
b/plugins/gitlab/tasks/mr_comment_convertor.go
index 7e7b0f79..bb3206cb 100644
--- a/plugins/gitlab/tasks/mr_comment_convertor.go
+++ b/plugins/gitlab/tasks/mr_comment_convertor.go
@@ -75,7 +75,7 @@ func ConvertMergeRequestComment(taskCtx core.SubTaskContext)
error {
},
PullRequestId:
prIdGen.Generate(data.Options.ConnectionId, gitlabComments.MergeRequestId),
Body: gitlabComments.Body,
- UserId:
accountIdGen.Generate(data.Options.ConnectionId, gitlabComments.AuthorUserId),
+ AccountId:
accountIdGen.Generate(data.Options.ConnectionId, gitlabComments.AuthorUserId),
CreatedDate: gitlabComments.GitlabCreatedAt,
}
domainComment.Type =
getStdCommentType(gitlabComments.Type)