Skip to content

[ZSvirt] bug: SDK sync polling swallows thread interruption #25

Description

@chayu163

Component

zsvirt

Problem description

ZSClient.syncPollResult sleeps between polling attempts with TimeUnit.MILLISECONDS.sleep(interval). When the
calling thread is interrupted, this throws InterruptedException and clears the thread's interrupt status flag. The
catch (InterruptedException e) block is empty (//ignore), so the flag is never restored and the loop keeps polling
until timeout.

Same file syncWebHookResult and the adjacent IOException branch both restore the flag via
Thread.currentThread().interrupt(), this one is missing.

Steps to reproduce

  1. Start a synchronous polling API call that returns 202 and keeps polling.
  2. Invoke Thread.currentThread().interrupt() on the calling thread during the sleep interval.

Expected behavior

Restore the interrupt status flag and propagate the interruption, matching syncWebHookResult.

Environment

No response

Logs or screenshots

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions