Skip to content

SchedulerLifecycleTest failures #3993

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

Closed
akarnokd opened this issue Jun 6, 2016 · 8 comments
Closed

SchedulerLifecycleTest failures #3993

akarnokd opened this issue Jun 6, 2016 · 8 comments

Comments

@akarnokd
Copy link
Member

akarnokd commented Jun 6, 2016

After merging #3986, these to fail in master (worked as PR):

rx.schedulers.SchedulerLifecycleTest > testShutdown FAILED
    java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@73f20bba rejected from java.util.concurrent.ScheduledThreadPoolExecutor@17e01bce[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
        at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048)
        at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821)
        at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:325)
        at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:530)
        at java.util.concurrent.ScheduledThreadPoolExecutor.execute(ScheduledThreadPoolExecutor.java:619)
        at rx.schedulers.SchedulerLifecycleTest.tryOutSchedulers(SchedulerLifecycleTest.java:98)
        at rx.schedulers.SchedulerLifecycleTest.testShutdown(SchedulerLifecycleTest.java:36)
rx.schedulers.SchedulerLifecycleTest > testStartIdempotence STARTED
rx.schedulers.SchedulerLifecycleTest > testStartIdempotence FAILED
    java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@18264a30 rejected from java.util.concurrent.ScheduledThreadPoolExecutor@17e01bce[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
        at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048)
        at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821)
        at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:325)
        at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:530)
        at java.util.concurrent.ScheduledThreadPoolExecutor.execute(ScheduledThreadPoolExecutor.java:619)
        at rx.schedulers.SchedulerLifecycleTest.tryOutSchedulers(SchedulerLifecycleTest.java:98)
        at rx.schedulers.SchedulerLifecycleTest.testStartIdempotence(SchedulerLifecycleTest.java:117)

@hzsweers can you have a look at these? (It's night time for me btw.)

@ZacSweers
Copy link
Contributor

Sure I'll take a look

@ZacSweers
Copy link
Contributor

ZacSweers commented Jun 6, 2016

They run fine on 1.x/master for me locally. Maybe something to do with Travis? Or related to or in the same vein as #3987?

@artem-zinnatullin
Copy link
Contributor

@hzsweers I guess it's related to CPU/cores configuration + machine state. Please try to run tests on Travis through your fork of RxJava (via PRs or other ways). Just add env variable TRAVIS_PULL_REQUEST=true on Travis for your fork.

P.S. sorry for "laugh" reaction, removed, thought that it was funny and "I've warned you" things, but this project is too significant to break it so yeah, sorry. I'll be here to review fix in few hours.

@artem-zinnatullin
Copy link
Contributor

artem-zinnatullin commented Jun 6, 2016

So we've chatted with @hzsweers about the problem, he has to go for few hours, if somebody interested in fixing that — looks like #3986 shuts down scheduler too early or tests that run after reset() see shutdowned scheduler or something like this:

ZacSweers@615d91e

rx.schedulers.ResetSchedulersTest > reset STARTED

rx.schedulers.SchedulerLifecycleTest > testShutdown STARTED

rx.schedulers.SchedulerLifecycleTest > testShutdown FAILED
    java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@4240096f rejected from java.util.concurrent.ScheduledThreadPoolExecutor@7a2b7863[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
        at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048)
        at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821)
        at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:325)
        at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:530)
        at java.util.concurrent.ScheduledThreadPoolExecutor.execute(ScheduledThreadPoolExecutor.java:619)
        at rx.schedulers.SchedulerLifecycleTest.tryOutSchedulers(SchedulerLifecycleTest.java:108)
        at rx.schedulers.SchedulerLifecycleTest.testShutdown(SchedulerLifecycleTest.java:46)

rx.schedulers.SchedulerLifecycleTest > testStartIdempotence STARTED

rx.schedulers.SchedulerLifecycleTest > testStartIdempotence FAILED
    java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@7cbac34b rejected from java.util.concurrent.ScheduledThreadPoolExecutor@7a2b7863[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
        at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048)
        at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821)
        at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:325)
        at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:530)

@artem-zinnatullin
Copy link
Contributor

So, Schedulers.reset() shuts down GenericScheduledExecutorService, then SchedulerLifecycleTest tries to run some tasks on it GenericScheduledExecutorService.getInstance().execute() and fails because reset() test already shut it down.

The fix would be to restart GenericScheduledExecutorService correctly in SchedulerLifecycleTest or Schedulers.reset() or GenericScheduledExecutorService.getInstance().

@akarnokd
Copy link
Member Author

akarnokd commented Jun 7, 2016

Yes, the reset is overscoped; it should only shutdown the main schedulers but leave the helper schedulers. I'll post a fix.

@ZacSweers
Copy link
Contributor

This can be closed now

@zsxwing
Copy link
Member

zsxwing commented Jun 13, 2016

Closing via #3996

@zsxwing zsxwing closed this as completed Jun 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants