httpclient shutdown in finalize result in long wait at JVM exit

Description

For some reason moving the shutdown of the HTTPclient.shutDown call to the finalize results in a long (30 seconds or more) wait at the exit of a Java app.

It is not quite clear what causes this, it seems to have to do with MultiThreadedHttpConnectionManager's cleanup thread. I have also tried to solve the issue by adding a shutdown hook, but this didn't solve the issue.

Possible fix is to invoke the shutdown in the Repository.shutdownInternal again. To avoid re-introducing we'll need to move initialization of the HTTPClient from the constructor to the initialize method.

Environment

None

Status

Assignee

Jeen Broekstra

Reporter

Jeen Broekstra

Labels

None

Fix versions

Affects versions

Priority

Critical
Configure