{"action":"created","issue":{"url":"https://api.github.com/repos/reactor/reactor-core/issues/1178","repository_url":"https://api.github.com/repos/reactor/reactor-core","labels_url":"https://api.github.com/repos/reactor/reactor-core/issues/1178/labels{/name}","comments_url":"https://api.github.com/repos/reactor/reactor-core/issues/1178/comments","events_url":"https://api.github.com/repos/reactor/reactor-core/issues/1178/events","html_url":"https://github.com/reactor/reactor-core/pull/1178","id":318829965,"number":1178,"title":"Unexpected behavior for Flux.interval when scheduled interval does not supported","user":{"login":"OlegDokuka","id":5380167,"avatar_url":"https://avatars3.githubusercontent.com/u/5380167?v=4","gravatar_id":"","url":"https://api.github.com/users/OlegDokuka","html_url":"https://github.com/OlegDokuka","followers_url":"https://api.github.com/users/OlegDokuka/followers","following_url":"https://api.github.com/users/OlegDokuka/following{/other_user}","gists_url":"https://api.github.com/users/OlegDokuka/gists{/gist_id}","starred_url":"https://api.github.com/users/OlegDokuka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OlegDokuka/subscriptions","organizations_url":"https://api.github.com/users/OlegDokuka/orgs","repos_url":"https://api.github.com/users/OlegDokuka/repos","events_url":"https://api.github.com/users/OlegDokuka/events{/privacy}","received_events_url":"https://api.github.com/users/OlegDokuka/received_events","type":"User","site_admin":false},"labels":[{"id":284719889,"url":"https://api.github.com/repos/reactor/reactor-core/labels/bug","name":"bug","color":"fc2929","default":true},{"id":577112149,"url":"https://api.github.com/repos/reactor/reactor-core/labels/consider%20backport","name":"consider backport","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/reactor/reactor-core/milestones/18","html_url":"https://github.com/reactor/reactor-core/milestone/18","labels_url":"https://api.github.com/repos/reactor/reactor-core/milestones/18/labels","id":2516193,"number":18,"title":"3.2.0.RELEASE","description":"","creator":{"login":"smaldini","id":76718,"avatar_url":"https://avatars2.githubusercontent.com/u/76718?v=4","gravatar_id":"","url":"https://api.github.com/users/smaldini","html_url":"https://github.com/smaldini","followers_url":"https://api.github.com/users/smaldini/followers","following_url":"https://api.github.com/users/smaldini/following{/other_user}","gists_url":"https://api.github.com/users/smaldini/gists{/gist_id}","starred_url":"https://api.github.com/users/smaldini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smaldini/subscriptions","organizations_url":"https://api.github.com/users/smaldini/orgs","repos_url":"https://api.github.com/users/smaldini/repos","events_url":"https://api.github.com/users/smaldini/events{/privacy}","received_events_url":"https://api.github.com/users/smaldini/received_events","type":"User","site_admin":false},"open_issues":33,"closed_issues":74,"state":"open","created_at":"2017-05-11T21:19:24Z","updated_at":"2018-05-07T13:50:49Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2018-04-30T09:23:02Z","updated_at":"2018-05-07T19:26:12Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/reactor/reactor-core/pulls/1178","html_url":"https://github.com/reactor/reactor-core/pull/1178","diff_url":"https://github.com/reactor/reactor-core/pull/1178.diff","patch_url":"https://github.com/reactor/reactor-core/pull/1178.patch"},"body":"Got an issue with Flux.interval when granularity of interval is nanoseconds, thus that time is rounded to zero milliseconds, hence default `java.util.concurrent.ScheduledExecutorService#scheduleAtFixedRate` does not support zero time according to documentation \r\n\r\n>  * @throws IllegalArgumentException if period less than or equal to zero\r\n     */\r\n    public ScheduledFuture<?> scheduleAtFixedRate(Runnable command,\r\n                                                  long initialDelay,\r\n                                                  long period,\r\n                                                  TimeUnit unit);\r\n\r\nDue to the current implementation, we handle only `RejectedTaskException`, which means that error will be propagated to `FluxInterval` which also catches only `RejectedTaskException`\r\n```\r\n@Override\r\n\tpublic void subscribe(CoreSubscriber<? super Long> actual) {\r\n\t\tWorker w = timedScheduler.createWorker();\r\n\r\n\t\tIntervalRunnable r = new IntervalRunnable(actual, w);\r\n\r\n\t\tactual.onSubscribe(r);\r\n\r\n\t\ttry {\r\n\t\t\tw.schedulePeriodically(r, initialDelay, period, unit);\r\n\t\t}\r\n\t\tcatch (RejectedExecutionException ree) {\r\n\t\t\tif (!r.cancelled) {\r\n\t\t\t\tactual.onError(Operators.onRejectedExecution(ree, r, null, null,\r\n\t\t\t\t\t\tactual.currentContext()));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n```\r\n\r\nHence `IllegalArgumentException` causes violation of RS."},"comment":{"url":"https://api.github.com/repos/reactor/reactor-core/issues/comments/387175495","html_url":"https://github.com/reactor/reactor-core/pull/1178#issuecomment-387175495","issue_url":"https://api.github.com/repos/reactor/reactor-core/issues/1178","id":387175495,"user":{"login":"OlegDokuka","id":5380167,"avatar_url":"https://avatars3.githubusercontent.com/u/5380167?v=4","gravatar_id":"","url":"https://api.github.com/users/OlegDokuka","html_url":"https://github.com/OlegDokuka","followers_url":"https://api.github.com/users/OlegDokuka/followers","following_url":"https://api.github.com/users/OlegDokuka/following{/other_user}","gists_url":"https://api.github.com/users/OlegDokuka/gists{/gist_id}","starred_url":"https://api.github.com/users/OlegDokuka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OlegDokuka/subscriptions","organizations_url":"https://api.github.com/users/OlegDokuka/orgs","repos_url":"https://api.github.com/users/OlegDokuka/repos","events_url":"https://api.github.com/users/OlegDokuka/events{/privacy}","received_events_url":"https://api.github.com/users/OlegDokuka/received_events","type":"User","site_admin":false},"created_at":"2018-05-07T19:26:12Z","updated_at":"2018-05-07T19:26:12Z","author_association":"CONTRIBUTOR","body":"Yeah, working on it. There is a chance that the `dispose` might not immediately dispose an execution, so I decided to wait a little bit and that compare tasks size"}}
{"actor":{"display_login":"OlegDokuka"}}