Skip to content

Spring Retry not working with Kotlin Async CoroutineΒ #303

Open
@nayanseth

Description

@nayanseth

Note: the below function test is being called via a launch coroutine.

The following code works:

@Retryable(value=[RetryException::class])
suspend fun test() {
  throw RetryException("blah")
}

However, the moment I add an async call, retry stops working:

@Retryable(value=[RetryException::class])
suspend fun test() {
  val deferred = supervisorScope {
    async { library.method() }
  }
  deferred.await()
  throw RetryException("blah")
}

What could be wrong?

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