Comments (3)
@zhengjianglong915 欢迎一起学习讨论哈。
以上代码不断叠加,不考虑 long 的最大值问题。当值超过最大值以后会出现溢出问题。
Disrupor 在设计的时候已经考虑到这个问题哈,我们使用数组长度为 2^n(SOFATracer 中我们是 2^10=1024) ,通过位运算,加快定位的速度。index 是 long 型最大值为 9223372036854775807
,假设我们有 100万 QPS 的处理速度,也大概需要 29.2 万年处理完成,虽然理论上存在溢出但是实际情况可以忽略哈。
至于你的截图中出现的赋值溢出的情况,推测是调式代码是,在如下这个地方:
在调试的时候,自己主动构造了一个这样的场景类似做了 cursor.addAndGet(Long.MAX_VALUE)
操作,而导致累加的 sequence 出现负数。
from sofa-tracer.
@guanchao-yang 嗯嗯,这边是debug 手动改动的。 因为看代码有疑问,验证是否有溢出问题,所以验证了下。 从您的计算上看是不可能出现这个溢出的问题, 我可能只考虑了代码变量边界问题,没考虑到您说的这个方面。 谢谢您。
from sofa-tracer.
@zhengjianglong915 不要客气哈,咱们互相学习,多多讨论。
from sofa-tracer.
Related Issues (20)
- OpenFeign 10.7.3+版本兼容问题 HOT 1
- 不使用sofa boot,使用spring boot parent,依赖tracer-sofa-boot-starter时启动报错 HOT 6
- does support dubbo async invoke??? HOT 1
- Redis plugin未恢复paren span,导致span id的层级无限增长
- Open Source Promotion Plan 2022 - upgrade opentracing api version & adapter opentelemetry api HOT 5
- SofaTracer如何支持Agent接入方式 HOT 2
- spring cloud 3中的openfeign支持 HOT 2
- spring cloud gateway webflux集成问题 HOT 1
- 基于SOFAArk实现类加载器加载外置的SofaTracer的Spring Boot Starter插件 HOT 4
- datasource 模块如何记录完整的 sql 语句,包含参数的那种
- sofatracer的tracerId不一定为30位 HOT 1
- sofa-tracer-httpclient-plugin使用httpclient连接池,请求发生异常时,内存泄漏,spanId无限变长 HOT 19
- sofa-tracer-kafkamq-plugin支持ProducerListener解决方案 HOT 1
- CI failed in the master branch
- classNotFound SofaTracerLoadBalancedFeignClient HOT 1
- 是否支持 SOFA-TraceId 由前端生成放到header中请求
- sofa-tracer redis plugin未串联父span
- dubbo 2.7 使用问题 HOT 1
- feat: Delegate java.util.concurrent.Executor
- springboot v3 版本 启动报错 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sofa-tracer.