Skip to content

IllegalStateException thrown when ribbonRestClient gets destroyed #22

@akefirad

Description

@akefirad

It's been discussed at spring-cloud-commons but I couldn't find any history here.
Does it help to add a simple check at least to get fewer exceptions:

public static boolean isShutdownInProgress() {
    try {
        Thread thread = new Thread();    
        Runtime.getRuntime().addShutdownHook(thread);
        Runtime.getRuntime().removeShutdownHook(thread);
        return false;
    } catch (IllegalStateException e) {
        return true;
    }
}

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