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
Improve the adaptation speed of polling algorithm #88
Conversation
@Particular/engineers @johnsimons can you review? |
Is the use of DateTime going to be problematic around Daylight Savings change-overs (i.e. Suddenly everything claims to be long running). You could do this with 2 flags. First check for "is long running" and "hasn't triggered another task" and trigger new tasks. Then mark everything as "long running". If they don't get reset before you get back around to them then they're long running. |
Not if we use UTC |
This works too :)
|
I |
|
||
public RealSimulator(string address, string connectionString) | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You little @andreasohlund you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the unnecessary line break?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Ufff. Disaster averted.
There is much complexity involved here. I wonder if it is really needed. The default |
Applied the suggestions. |
* Extracted all constants controlling scheduler to AdaptivePollingReceiver * Added role interface for the back-off strategy * Decoupled the sender and receiver from the pipeline ContextItemRemovalDisposable * Removed the ITaskTracker abstraction
c871c46
to
7b37d23
Compare
@SzymonPobiega I reviewed the PR on my flight on Friday and it all seemed to make sense. BTW - I did some minor refactorings as I was reading the code, if you want to cherry pick them they are on https://github.com/adamralph/NServiceBus.SqlServer/commits/make-scheduler-adapt-faster-refactor Before we merge, I'd like to second @danielmarbach's comment. Do we have evidence that this isn't already a solved problem .NET's default |
- simplify RecalculateDelay() - rename maximum to maximumDelay - introduce defaultDelay to remove duplication
Make scheduler adapt faster
Woot! My first commits to core 😛 |
@adamralph What about Rabbit? |
not core? |
Oops, this is sql... And I already have 3 commits in core. Ignore me. As you were. 😊 |
Be quick, merge this one: Particular/NServiceBus#2884 |
@ramonsmits and all, it looks like 2.1.4 fix[https://github.com//issues/90] was not merged into 2.2.0? If we upgrade we'll reintroduce the memory leak of 2.1.3: https://github.com/Particular/NServiceBus.SqlServer/blob/2.2.0/src/NServiceBus.SqlServer/AdaptiveExecutor.cs |
My bad, it is merged in master.,, |
BackOff
class to be testableBehaviorContext
in order to test them easierAdaptivePollingReceiver
class