You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/05/29 14:13:31 UTC

[GitHub] [dubbo-go-pixiu] maxingg opened a new pull request, #435: fix: Concurrent in NewTracer and GetTracer methods.

maxingg opened a new pull request, #435:
URL: https://github.com/apache/dubbo-go-pixiu/pull/435

   **What this PR does**:
   Creating and retrieving tracers and holders has thread safety issues in concurrent cases, which are fixed using sync.Map and CAS.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-pixiu] mark4z merged pull request #435: fix: Concurrent in NewTracer and GetTracer methods.

Posted by GitBox <gi...@apache.org>.
mark4z merged PR #435:
URL: https://github.com/apache/dubbo-go-pixiu/pull/435


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-pixiu] AlexStocks commented on a diff in pull request #435: fix: Concurrent in NewTracer and GetTracer methods.

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on code in PR #435:
URL: https://github.com/apache/dubbo-go-pixiu/pull/435#discussion_r884279476


##########
pkg/server/otel.go:
##########
@@ -87,9 +87,13 @@ func NewTracer(name tracing.ProtocolName) (tracing.Trace, error) {
 	}
 	holder := driver.GetHolder(name)
 
+	old := holder.ID
+	for !atomic.CompareAndSwapUint64(&holder.ID, old, old+1) {
+		old = holder.ID

Review Comment:
   是不是可以加上 time.Sleep(50e6) 这个语句啊?别搞不好成了死循环



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-pixiu] AlexStocks commented on a diff in pull request #435: fix: Concurrent in NewTracer and GetTracer methods.

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on code in PR #435:
URL: https://github.com/apache/dubbo-go-pixiu/pull/435#discussion_r884279566


##########
pkg/server/otel.go:
##########
@@ -87,9 +87,13 @@ func NewTracer(name tracing.ProtocolName) (tracing.Trace, error) {
 	}
 	holder := driver.GetHolder(name)
 
+	old := holder.ID
+	for !atomic.CompareAndSwapUint64(&holder.ID, old, old+1) {
+		old = holder.ID

Review Comment:
   至少别太耗费 cpu



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] fix: Concurrent in NewTracer and GetTracer methods. [dubbo-go-pixiu]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #435:
URL: https://github.com/apache/dubbo-go-pixiu/pull/435#issuecomment-4186011098

   ## [Codecov](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/435?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `0%` with `6 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 37.63%. Comparing base ([`a274007`](https://app.codecov.io/gh/apache/dubbo-go-pixiu/commit/a274007ac28ad1564892679fd379d9cb9936e92a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`50b11f9`](https://app.codecov.io/gh/apache/dubbo-go-pixiu/commit/50b11f9427e8e7bb5b891accf4b3dfa0badfa1ae?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 316 commits behind head on develop.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/435?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [pkg/server/otel.go](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/435?src=pr&el=tree&filepath=pkg%2Fserver%2Fotel.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGtnL3NlcnZlci9vdGVsLmdv) | 0.00% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/435?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff             @@
   ##           develop     #435      +/-   ##
   ===========================================
   - Coverage    37.67%   37.63%   -0.05%     
   ===========================================
     Files           55       55              
     Lines         3740     3744       +4     
   ===========================================
     Hits          1409     1409              
   - Misses        2174     2177       +3     
   - Partials       157      158       +1     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/435?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-pixiu] mark4z commented on pull request #435: fix: Concurrent in NewTracer and GetTracer methods.

Posted by GitBox <gi...@apache.org>.
mark4z commented on PR #435:
URL: https://github.com/apache/dubbo-go-pixiu/pull/435#issuecomment-1142152942

   fix go fit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-pixiu] maxingg commented on a diff in pull request #435: fix: Concurrent in NewTracer and GetTracer methods.

Posted by GitBox <gi...@apache.org>.
maxingg commented on code in PR #435:
URL: https://github.com/apache/dubbo-go-pixiu/pull/435#discussion_r884292136


##########
pkg/server/otel.go:
##########
@@ -87,9 +87,13 @@ func NewTracer(name tracing.ProtocolName) (tracing.Trace, error) {
 	}
 	holder := driver.GetHolder(name)
 
+	old := holder.ID
+	for !atomic.CompareAndSwapUint64(&holder.ID, old, old+1) {
+		old = holder.ID

Review Comment:
   已经改成原子自增操作



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org