Skip to content

Conversation

@AbdelHedhili
Copy link
Contributor

No description provided.

Signed-off-by: Abdelsalem <[email protected]>
@AbdelHedhili AbdelHedhili self-assigned this Oct 16, 2025
AbdelHedhili and others added 6 commits October 28, 2025 11:46
Signed-off-by: Abdelsalem <[email protected]>
Springboot now uses httpclients detected from the classpath,
in our case ReactorClient. The workaround is to go back to using restclient
simple as the resttemplate implementation in networkstore service.
This has the additional advantage of avoiding 20 exta threads for netty..

For some reason (I don't know if it's a bug in
reactor client or a bug in our code...), during network store flush
after a modification, sometimes one of the http requests never returns
from reactorclient. So our code blocks infinitely in the message consumer
waiting for the http requests to return (waitAllFutures)

Additionally, we can see in the network store server logs "java.net.SocketTimeoutException"
after 30s.

Threads when blocked

Thread A
    at app//com.powsybl.network.store.client.util.ExecutorUtil.waitAllFutures(ExecutorUtil.java:52)
    at app//com.powsybl.network.store.client.BufferedNetworkStoreClient.flush(BufferedNetworkStoreClient.java:599)
    at app//com.powsybl.network.store.iidm.impl.AbstractForwardingNetworkStoreClient.flush(AbstractForwardingNetworkStoreClient.java:18)
    at app//com.powsybl.network.store.iidm.impl.AbstractForwardingNetworkStoreClient.flush(AbstractForwardingNetworkStoreClient.java:18)
    at app//com.powsybl.network.store.client.NetworkStoreService.flush(NetworkStoreService.java:246)
    at app//org.gridsuite.modification.server.modifications.NetworkStoreListener.flushModificationApplications(NetworkStoreListener.java:264)

"pool-2-thread-2" - Thread t@111
   java.lang.Thread.State: WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        - parking to wait for <26231e99> (a java.util.concurrent.CountDownLatch$Sync)
        at [email protected]/java.util.concurrent.locks.LockSupport.park(Unknown Source)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(Unknown Source)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(Unknown Source)
        at [email protected]/java.util.concurrent.CountDownLatch.await(Unknown Source)
        at app//reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:91)
        at app//reactor.core.publisher.Mono.block(Mono.java:1779)
        at app//org.springframework.http.client.ReactorClientHttpRequest.executeInternal(ReactorClientHttpRequest.java:129)
        at app//org.springframework.http.client.AbstractStreamingClientHttpRequest.executeInternal(AbstractStreamingClientHttpRequest.java:71)
        at app//org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:81)
        at app//org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:900)
        at app//org.springframework.web.client.RestTemplate.execute(RestTemplate.java:801)
        at app//org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:683)
        at app//com.powsybl.network.store.client.RestClientImpl.updateAll(RestClientImpl.java:134)

Also, because we kind of miscoded the NetworkStoreService, it can't use standards spring boot systems
(RestTemplateCustomizer, or --spring.http.client.factory=simple) to change its behavior, so we have
to override it fully with @primary
@sonarqubecloud
Copy link

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants