Skip to content

Question: Why a running computation thread got interrupted while window is finished #6672

Closed
@zubchenok

Description

@zubchenok

Why an active computation thread got interrupted while window is finished?

        Observable
            .intervalRange(0, 2, 0, 1, TimeUnit.SECONDS)
            .window(1, TimeUnit.SECONDS)
            .doOnNext(i -> {
                long start = System.currentTimeMillis();
                while (System.currentTimeMillis() < start+1500) {
                }
                if (Thread.interrupted()) {
                    System.out.println("WTF? Thread is interrupted!");
                }
            })
            .ignoreElements()
            .blockingAwait();

Is it a bug?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions