We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go version go1.22.1 windows/amd64
处理器 12th Gen Intel(R) Core(TM) i7-12700H 2.30 GHz 系统类型 64 位操作系统, 基于 x64 的处理器
go run main.go version 2.1.2
// Sentinel 限流 func Sentinel() gin.HandlerFunc { if _, err := system.LoadRules([]*system.Rule{ { MetricType: system.InboundQPS, TriggerCount: 200, Strategy: system.BBR, }, }); err != nil { log.Fatalf("Unexpected error: %+v", err) } return sentinel.SentinelMiddleware( sentinel.WithBlockFallback(func(ctx *gin.Context) { ctx.AbortWithStatusJSON(200, map[string]interface{}{ "msg": "too many request; the quota used up!", "code": 500, }) }), ) }
是阿里那个包的问题么
github.com/alibaba/sentinel-golang/core/stat/base.(*AtomicBucketWrapArray).elementOffset C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/base/leap_array.go:108 github.com/alibaba/sentinel-golang/core/stat/base.(*AtomicBucketWrapArray).compareAndSet C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/base/leap_array.go:130 github.com/alibaba/sentinel-golang/core/stat/base.(*LeapArray).currentBucketOfTime C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/base/leap_array.go:194 github.com/alibaba/sentinel-golang/core/stat/base.(*BucketLeapArray).currentBucketWithTime C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/base/bucket_leap_array.go:112 github.com/alibaba/sentinel-golang/core/stat/base.(*BucketLeapArray).updateConcurrencyWithTime C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/base/bucket_leap_array.go:104 github.com/alibaba/sentinel-golang/core/stat/base.(*BucketLeapArray).UpdateConcurrency C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/base/bucket_leap_array.go:100 github.com/alibaba/sentinel-golang/core/stat.(*BaseStatNode).UpdateConcurrency C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/base_node.go:72 github.com/alibaba/sentinel-golang/core/stat.(*BaseStatNode).IncreaseConcurrency C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/base_node.go:96 github.com/alibaba/sentinel-golang/core/stat.(*Slot).recordPassFor C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/stat_slot.go:80 github.com/alibaba/sentinel-golang/core/stat.(*Slot).OnEntryPassed C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/stat_slot.go:50 github.com/alibaba/sentinel-golang/core/base.(*SlotChain).Entry C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/base/slot_chain.go:211 github.com/alibaba/sentinel-golang/api.entry C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/api/api.go:169 github.com/alibaba/sentinel-golang/api.Entry C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/api/api.go:146 github.com/alibaba/sentinel-golang/pkg/adapters/gin.SentinelMiddleware.func1 C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang/pkg/adapters/gin@v0.0.0-20230626085943-08071855bc67/middleware.go:24 github.com/gin-gonic/gin.(*Context).Next C:/Users/18796/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 github.com/gin-gonic/gin.(*Engine).handleHTTPRequest C:/Users/18796/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620 github.com/gin-gonic/gin.(*Engine).ServeHTTP C:/Users/18796/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576 net/http.serverHandler.ServeHTTP C:/Program Files/Go/src/net/http/server.go:3137 net/http.(*conn).serve C:/Program Files/Go/src/net/http/server.go:2039 runtime.goexit C:/Program Files/Go/src/runtime/asm_386.s:1363 {"timestamp":"2024-03-30 14:59:52.52300","caller":"leap_array.go:108","logLevel":"ERROR","msg":"array index out of bounds in AtomicBucketWrapArray.elementOffset()","idx":-3,"arrayLength":20} array index out of bounds
The text was updated successfully, but these errors were encountered:
我也遇到了,有人解决了吗?是不是go版本问题
Sorry, something went wrong.
同遇到,有人解决了吗
No branches or pull requests
go version go1.22.1 windows/amd64
处理器 12th Gen Intel(R) Core(TM) i7-12700H 2.30 GHz
系统类型 64 位操作系统, 基于 x64 的处理器
go run main.go version
2.1.2
// Sentinel 限流
func Sentinel() gin.HandlerFunc {
if _, err := system.LoadRules([]*system.Rule{
{
MetricType: system.InboundQPS,
TriggerCount: 200,
Strategy: system.BBR,
},
}); err != nil {
log.Fatalf("Unexpected error: %+v", err)
}
return sentinel.SentinelMiddleware(
sentinel.WithBlockFallback(func(ctx *gin.Context) {
ctx.AbortWithStatusJSON(200, map[string]interface{}{
"msg": "too many request; the quota used up!",
"code": 500,
})
}),
)
}
是阿里那个包的问题么
github.com/alibaba/sentinel-golang/core/stat/base.(*AtomicBucketWrapArray).elementOffset
C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/base/leap_array.go:108
github.com/alibaba/sentinel-golang/core/stat/base.(*AtomicBucketWrapArray).compareAndSet
C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/base/leap_array.go:130
github.com/alibaba/sentinel-golang/core/stat/base.(*LeapArray).currentBucketOfTime
C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/base/leap_array.go:194
github.com/alibaba/sentinel-golang/core/stat/base.(*BucketLeapArray).currentBucketWithTime
C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/base/bucket_leap_array.go:112
github.com/alibaba/sentinel-golang/core/stat/base.(*BucketLeapArray).updateConcurrencyWithTime
C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/base/bucket_leap_array.go:104
github.com/alibaba/sentinel-golang/core/stat/base.(*BucketLeapArray).UpdateConcurrency
C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/base/bucket_leap_array.go:100
github.com/alibaba/sentinel-golang/core/stat.(*BaseStatNode).UpdateConcurrency
C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/base_node.go:72
github.com/alibaba/sentinel-golang/core/stat.(*BaseStatNode).IncreaseConcurrency
C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/base_node.go:96
github.com/alibaba/sentinel-golang/core/stat.(*Slot).recordPassFor
C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/stat_slot.go:80
github.com/alibaba/sentinel-golang/core/stat.(*Slot).OnEntryPassed
C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/stat/stat_slot.go:50
github.com/alibaba/sentinel-golang/core/base.(*SlotChain).Entry
C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/core/base/slot_chain.go:211
github.com/alibaba/sentinel-golang/api.entry
C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/api/api.go:169
github.com/alibaba/sentinel-golang/api.Entry
C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang@v1.0.4/api/api.go:146
github.com/alibaba/sentinel-golang/pkg/adapters/gin.SentinelMiddleware.func1
C:/Users/18796/go/pkg/mod/github.com/alibaba/sentinel-golang/pkg/adapters/gin@v0.0.0-20230626085943-08071855bc67/middleware.go:24
github.com/gin-gonic/gin.(*Context).Next
C:/Users/18796/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
C:/Users/18796/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
C:/Users/18796/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
net/http.serverHandler.ServeHTTP
C:/Program Files/Go/src/net/http/server.go:3137
net/http.(*conn).serve
C:/Program Files/Go/src/net/http/server.go:2039
runtime.goexit
C:/Program Files/Go/src/runtime/asm_386.s:1363
{"timestamp":"2024-03-30 14:59:52.52300","caller":"leap_array.go:108","logLevel":"ERROR","msg":"array index out of bounds in AtomicBucketWrapArray.elementOffset()","idx":-3,"arrayLength":20}
array index out of bounds
The text was updated successfully, but these errors were encountered: