Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Naksha_1.1.5

- Improved DataSource cache refresh handling in txn-handler submodule to gracefully close active DB connections

## Naksha_1.1.4

- Increased header size limit to 24k

## Naksha_1.1.3

- Increased DB Pool size of Naksha Admin DB from 10 to 25 to allow additional sequencer/publisher jobs to run in parallel.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

<groupId>com.here.xyz</groupId>
<artifactId>xyz-hub</artifactId>
<version>1.1.3</version>
<version>1.1.5</version>
<packaging>pom</packaging>

<modules>
Expand Down
2 changes: 1 addition & 1 deletion xyz-connectors/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<groupId>com.here.xyz</groupId>
<artifactId>xyz-hub</artifactId>
<relativePath>../</relativePath>
<version>1.1.3</version>
<version>1.1.5</version>
</parent>

<licenses>
Expand Down
2 changes: 1 addition & 1 deletion xyz-hub-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<groupId>com.here.xyz</groupId>
<artifactId>xyz-hub</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.1.3</version>
<version>1.1.5</version>
</parent>

<licenses>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public abstract class AbstractHttpServerVerticle extends AbstractVerticle {
.setTcpQuickAck(true)
.setTcpFastOpen(true)
.setMaxInitialLineLength(16 * 1024)
.setMaxHeaderSize(16*1024)
.setMaxHeaderSize(24*1024)
.setIdleTimeout(300);
public static final String STREAM_INFO_CTX_KEY = "streamInfo";

Expand Down
2 changes: 1 addition & 1 deletion xyz-hub-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<groupId>com.here.xyz</groupId>
<artifactId>xyz-hub</artifactId>
<relativePath>../</relativePath>
<version>1.1.3</version>
<version>1.1.5</version>
</parent>

<licenses>
Expand Down
2 changes: 1 addition & 1 deletion xyz-models/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<groupId>com.here.xyz</groupId>
<artifactId>xyz-hub</artifactId>
<relativePath>../</relativePath>
<version>1.1.3</version>
<version>1.1.5</version>
</parent>

<licenses>
Expand Down
2 changes: 1 addition & 1 deletion xyz-psql-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<groupId>com.here.xyz</groupId>
<artifactId>xyz-hub</artifactId>
<relativePath>../</relativePath>
<version>1.1.3</version>
<version>1.1.5</version>
</parent>

<licenses>
Expand Down
2 changes: 1 addition & 1 deletion xyz-txn-handler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<groupId>com.here.xyz</groupId>
<artifactId>xyz-hub</artifactId>
<relativePath>../</relativePath>
<version>1.1.3</version>
<version>1.1.5</version>
</parent>

<licenses>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
public class PubJdbcConnectionPool {
private static final Logger logger = LogManager.getLogger();

// Entire cache will be flushed every x hours (e.g. 8hrs) to prevent pile-up of stale data
final private static int dsCacheExpiryInMins = 8*60;
// Entire cache will be flushed every x hours (e.g. 1hrs) to prevent pile-up of stale data
final private static int dsCacheExpiryInMins = 1 * 60;
private static long dsCacheExpiryEpochMs = System.currentTimeMillis() + TimeUnit.MINUTES.toMillis(dsCacheExpiryInMins);
private static ConcurrentHashMap<JdbcConnectionParams, HikariDataSource> dsCache = new ConcurrentHashMap<>();

Expand Down Expand Up @@ -51,14 +51,16 @@ private synchronized static void flushDataSourceCache(final String spaceId) {
for (JdbcConnectionParams connParams : dsCache.keySet()) {
flushThisDS = (spaceId == null || spaceId.equals(connParams.getSpaceId()));
if (flushThisDS) {
dsCache.get(connParams).close(); // close datasource
dsCache.remove(connParams); // remove datasource from cache
final HikariDataSource oldDs = dsCache.remove(connParams); // remove old datasource from cache
if (oldDs != null) {
oldDs.close(); // close old datasource gracefully
}
logger.info("Removed old cached DataSource for spaceId {}.", connParams.getSpaceId());
}
}
// reset cache (if it is full cache flush)
if (spaceId == null) {
dsCache = new ConcurrentHashMap<>();
dsCache.clear();
dsCacheExpiryEpochMs = System.currentTimeMillis() + TimeUnit.MINUTES.toMillis(dsCacheExpiryInMins);
logger.info("Recreated DataSource Cache with expiry of {}mins.", dsCacheExpiryInMins);
}
Expand All @@ -74,7 +76,7 @@ private static synchronized HikariDataSource createAndCacheDataSource(final Jdbc
// Create new Datasource (connection pool) and add it to a cache
final HikariConfig config = new HikariConfig();
String dbUrl = dbConnParams.getDbUrl();
dbUrl += (dbUrl.contains("?") ? "&" : "?") + "ApplicationName=XYZ-Hub-Publisher";
dbUrl += (dbUrl.contains("?") ? "&" : "?") + "ApplicationName=XYZ-Hub-Publisher_"+dbConnParams.getSpaceId();
config.setDriverClassName(dbConnParams.getDriveClass());
config.setJdbcUrl(dbUrl);
config.setUsername(dbConnParams.getUser());
Expand Down
Loading