Skip to content

Commit 1c8fe2b

Browse files
authored
Merge pull request #873 from nimsara66/8129-master
Improve high frequent connection logins over the error 'broken-pipe' …
2 parents a40ef53 + 5403bbd commit 1c8fe2b

File tree

1 file changed

+4
-6
lines changed
  • components/data-bridge/org.wso2.carbon.databridge.agent/src/main/java/org/wso2/carbon/databridge/agent/endpoint

1 file changed

+4
-6
lines changed

components/data-bridge/org.wso2.carbon.databridge.agent/src/main/java/org/wso2/carbon/databridge/agent/endpoint/DataEndpoint.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,16 +350,14 @@ public void setPoolSemaphore(Semaphore semaphore) {
350350
}
351351

352352
private void publish() throws DataEndpointException, SessionTimeoutException, UndefinedEventTypeException {
353-
Object client = getClient();
354353
if (invalidateTransportPool) {
355-
log.debug(
356-
"invalidateTransportPool' is 'true'. Going to discard existing client and get new client " +
357-
"for the DataEndpoint");
358-
discardClient(client);
359-
client = getClient();
354+
transportPool.clear(getDataEndpointConfiguration().getPublisherKey());
355+
log.debug("invalidateTransportPool' is 'true'. Discarding clients for the DataEndpoint: " +
356+
getDataEndpointConfiguration().getPublisherKey());
360357
invalidateTransportPool = false;
361358
log.debug("'invalidateTransportPool' is set to 'false' for the DataEndpoint");
362359
}
360+
Object client = getClient();
363361
try {
364362
send(client, this.events);
365363
semaphoreRelease();

0 commit comments

Comments
 (0)