Skip to content
New issue

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

waitTime in RateLimiterController may be negative #420

Closed
CarpenterLee opened this issue Jan 15, 2019 · 1 comment
Closed

waitTime in RateLimiterController may be negative #420

CarpenterLee opened this issue Jan 15, 2019 · 1 comment
Labels
kind/bug Category issues or prs related to bug.
Milestone

Comments

@CarpenterLee
Copy link
Contributor

Issue Description

Type: bug report

Describe what happened (or what feature you want)

waitTime in RateLimiterController may be negative, which will lead a java.lang.IllegalArgumentException, the stack trace is as flow:

2019-01-14 12:51:50 Entry exception
java.lang.IllegalArgumentException: timeout value is negative
        at java.lang.Thread.sleep(Native Method)
        at com.alibaba.csp.sentinel.slots.block.flow.controller.RateLimiterController.canPass(RateLimiterController.java:67)
        at com.alibaba.csp.sentinel.slots.block.flow.FlowRule.passCheck(FlowRule.java:168)
        at com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager.checkFlow(FlowRuleManager.java:159)
        at com.alibaba.csp.sentinel.slots.block.flow.FlowSlot.entry(FlowSlot.java:117)
        at com.alibaba.csp.sentinel.slots.block.flow.FlowSlot.entry(FlowSlot.java:111)
        at com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot.transformEntry(AbstractLinkedProcessorSlot.java:40)
        at com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot.fireEntry(AbstractLinkedProcessorSlot.java:32)
        at com.alibaba.csp.sentinel.slots.block.authority.AuthoritySlot.entry(AuthoritySlot.java:39)
        at com.alibaba.csp.sentinel.slots.block.authority.AuthoritySlot.entry(AuthoritySlot.java:33)
        at com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot.transformEntry(AbstractLinkedProcessorSlot.java:40)
        at com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot.fireEntry(AbstractLinkedProcessorSlot.java:32)
        at com.alibaba.csp.sentinel.slots.system.SystemSlot.entry(SystemSlot.java:36)
        at com.alibaba.csp.sentinel.slots.system.SystemSlot.entry(SystemSlot.java:30)
        at com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot.transformEntry(AbstractLinkedProcessorSlot.java:40)
        at com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot.fireEntry(AbstractLinkedProcessorSlot.java:32)
        at com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowSlot.entry(ParamFlowSlot.java:54)
        at com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowSlot.entry(ParamFlowSlot.java:39)
        at com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot.transformEntry(AbstractLinkedProcessorSlot.java:40)
        at com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot.fireEntry(AbstractLinkedProcessorSlot.java:32)
        at com.alibaba.csp.sentinel.slots.statistic.StatisticSlot.entry(StatisticSlot.java:54)
        at com.alibaba.csp.sentinel.slots.statistic.StatisticSlot.entry(StatisticSlot.java:48)
        at com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot.transformEntry(AbstractLinkedProcessorSlot.java:40)
        at com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot.fireEntry(AbstractLinkedProcessorSlot.java:32)
        at com.alibaba.csp.sentinel.slots.logger.LogSlot.entry(LogSlot.java:35)
        at com.alibaba.csp.sentinel.slots.logger.LogSlot.entry(LogSlot.java:29)
        at com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot.transformEntry(AbstractLinkedProcessorSlot.java:40)
        at com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot.fireEntry(AbstractLinkedProcessorSlot.java:32)
        at com.alibaba.csp.sentinel.slots.clusterbuilder.ClusterBuilderSlot.entry(ClusterBuilderSlot.java:103)
        at com.alibaba.csp.sentinel.slots.clusterbuilder.ClusterBuilderSlot.entry(ClusterBuilderSlot.java:48)
        at com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot.transformEntry(AbstractLinkedProcessorSlot.java:40)
        at com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot.fireEntry(AbstractLinkedProcessorSlot.java:32)
        at com.alibaba.csp.sentinel.slots.nodeselector.NodeSelectorSlot.entry(NodeSelectorSlot.java:171)
        at com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot.transformEntry(AbstractLinkedProcessorSlot.java:40)
        at com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot.fireEntry(AbstractLinkedProcessorSlot.java:32)
        at com.alibaba.csp.sentinel.slotchain.DefaultProcessorSlotChain$1.entry(DefaultProcessorSlotChain.java:31)
        at com.alibaba.csp.sentinel.slotchain.AbstractLinkedProcessorSlot.transformEntry(AbstractLinkedProcessorSlot.java:40)
        at com.alibaba.csp.sentinel.slotchain.DefaultProcessorSlotChain.entry(DefaultProcessorSlotChain.java:75)
        at com.alibaba.csp.sentinel.CtSph.entry(CtSph.java:157)
        at com.alibaba.csp.sentinel.CtSph.entry(CtSph.java:300)
        at com.alibaba.csp.sentinel.SphU.entry(SphU.java:86)
......

Describe what you expected to happen

Wait time should never be negative.

How to reproduce it (as minimally and precisely as possible)

It dose not usually happen, I see it in sentinel-record.log.

Tell us your environment

Sentinel SDK 1.3.1

Anything else we need to know?

none.

@CarpenterLee CarpenterLee added the kind/bug Category issues or prs related to bug. label Jan 15, 2019
@CarpenterLee CarpenterLee reopened this Jan 16, 2019
@CarpenterLee
Copy link
Contributor Author

Fixed by commit c45d64c

@sczyh30 sczyh30 added this to the 1.4.2 milestone Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Category issues or prs related to bug.
Projects
None yet
Development

No branches or pull requests

2 participants