You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "He-Pin (via GitHub)" <gi...@apache.org> on 2024/06/15 10:06:46 UTC
[PR] feat: Support adjust the scheduler's tick-duration. [pekko]
He-Pin opened a new pull request, #1366:
URL: https://github.com/apache/pekko/pull/1366
Motivation:
refs: https://github.com/apache/pekko/issues/1364
Modification:
Add another config `pekko.scheduler.error-on-tick-duration-verification-failed = on` by default and can be changed to `off` when needed.
Result:
Better experience
--
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@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] feat: Support adjust the scheduler's tick-duration. [pekko]
Posted by "jxnu-liguobin (via GitHub)" <gi...@apache.org>.
jxnu-liguobin commented on code in PR #1366:
URL: https://github.com/apache/pekko/pull/1366#discussion_r1640983695
##########
actor-tests/src/test/scala/org/apache/pekko/actor/SchedulerSpec.scala:
##########
@@ -40,6 +41,13 @@ object SchedulerSpec {
pekko.scheduler.ticks-per-wheel = 32
""").withFallback(PekkoSpec.testConf)
+ val testConfAdjustment =
+ ConfigFactory.parseString("""
+ pekko.scheduler.implementation = org.apache.pekko.actor.LightArrayRevolverScheduler
+ pekko.scheduler.tick-duration = 1ns
Review Comment:
ns?
--
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@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] feat: Support adjust the scheduler's tick-duration. [pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #1366:
URL: https://github.com/apache/pekko/pull/1366#discussion_r1641133602
##########
actor/src/main/scala/org/apache/pekko/actor/LightArrayRevolverScheduler.scala:
##########
@@ -54,18 +54,35 @@ class LightArrayRevolverScheduler(config: Config, log: LoggingAdapter, threadFac
import Helpers.ConfigOps
import Helpers.Requiring
- val WheelSize =
+ val WheelSize: Int =
config
.getInt("pekko.scheduler.ticks-per-wheel")
.requiring(ticks => (ticks & (ticks - 1)) == 0, "ticks-per-wheel must be a power of 2")
- val TickDuration =
- config
- .getMillisDuration("pekko.scheduler.tick-duration")
- .requiring(
- _ >= 10.millis || !Helpers.isWindows,
- "minimum supported pekko.scheduler.tick-duration on Windows is 10ms")
- .requiring(_ >= 1.millis, "minimum supported pekko.scheduler.tick-duration is 1ms")
- val ShutdownTimeout = config.getMillisDuration("pekko.scheduler.shutdown-timeout")
+
+ val TickDuration: FiniteDuration = {
+ val durationFromConfig = config.getMillisDuration("pekko.scheduler.tick-duration")
+ val errorOnVerificationFailed = config.getBoolean("pekko.scheduler.error-on-tick-duration-verification-failed")
+
+ if (Helpers.isWindows && durationFromConfig < 10.millis) {
+ if (errorOnVerificationFailed) {
+ throw new IllegalArgumentException(
+ "requirement failed: minimum supported pekko.scheduler.tick-duration on Windows is 10ms")
+ } else {
+ log.warning(
+ "requirement failed: minimum supported pekko.scheduler.tick-duration on Windows is 10ms, adjusted to 10ms now.")
+ 10.millis
+ }
+ } else if (durationFromConfig < 1.millis) {
Review Comment:
Can you move this inside the other other check to improve performance - avoiding 2 checks in happy path?
appproximately
```
if <10ms {
if (isWindows) {
... windows warning or throw
} else if < 1ms {
... 1ms warning or throw
} else durationFromConfig
}
```
--
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@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] feat: Support adjust the scheduler's tick-duration. [pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #1366:
URL: https://github.com/apache/pekko/pull/1366#discussion_r1640987619
##########
actor-tests/src/test/scala/org/apache/pekko/actor/SchedulerSpec.scala:
##########
@@ -40,6 +41,13 @@ object SchedulerSpec {
pekko.scheduler.ticks-per-wheel = 32
""").withFallback(PekkoSpec.testConf)
+ val testConfAdjustment =
+ ConfigFactory.parseString("""
+ pekko.scheduler.implementation = org.apache.pekko.actor.LightArrayRevolverScheduler
+ pekko.scheduler.tick-duration = 1ns
Review Comment:
Yes, I want to test that case
--
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@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] feat: Support adjust the scheduler's tick-duration. [pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin merged PR #1366:
URL: https://github.com/apache/pekko/pull/1366
--
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@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org