mirror of
https://github.com/corda/corda.git
synced 2025-02-20 17:33:15 +00:00
CORDA-4120: Disable the URLConnection cache to prevent file handle leaks in ServiceLoader. (#6869)
This commit is contained in:
parent
20dbbf008d
commit
1a7401472f
@ -173,6 +173,7 @@ import org.jolokia.jvmagent.JolokiaServerConfig
|
||||
import org.slf4j.Logger
|
||||
import rx.Scheduler
|
||||
import java.lang.reflect.InvocationTargetException
|
||||
import java.net.URLConnection
|
||||
import java.sql.Connection
|
||||
import java.sql.Savepoint
|
||||
import java.time.Clock
|
||||
@ -237,6 +238,7 @@ abstract class AbstractNode<S>(val configuration: NodeConfiguration,
|
||||
}
|
||||
|
||||
quasarExcludePackages(configuration)
|
||||
disableURLConnectionCache()
|
||||
|
||||
if (allowHibernateToManageAppSchema && !configuration.devMode) {
|
||||
throw ConfigurationException("Hibernate can only be used to manage app schema in development while using dev mode. " +
|
||||
@ -425,6 +427,13 @@ abstract class AbstractNode<S>(val configuration: NodeConfiguration,
|
||||
}
|
||||
}
|
||||
|
||||
private fun disableURLConnectionCache() {
|
||||
object : URLConnection(null) {
|
||||
override fun connect() {
|
||||
}
|
||||
}.defaultUseCaches = false
|
||||
}
|
||||
|
||||
private fun quasarExcludePackages(nodeConfiguration: NodeConfiguration) {
|
||||
val quasarInstrumentor = Retransform.getInstrumentor()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user