fvaleri commented on a change in pull request #3950:
URL: https://github.com/apache/activemq-artemis/pull/3950#discussion_r808930260
##########
File path:
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcLeaseLock.java
##########
@@ -147,14 +148,13 @@ private long dbCurrentTimeMillis(Connection connection)
throws SQLException {
try (ResultSet resultSet = currentDateTime.executeQuery()) {
resultSet.next();
final long endTime = stripMilliseconds(System.currentTimeMillis());
- final Timestamp currentTimestamp = resultSet.getTimestamp(1);
- final long currentTime = currentTimestamp.getTime();
- final long currentTimeMillis = stripMilliseconds(currentTime);
- if (currentTimeMillis < startTime) {
- LOGGER.warnf("[%s] %s query currentTimestamp = %s on database
should happen AFTER %s on broker", lockName, holderId, currentTimestamp, new
Timestamp(startTime));
+ final long currentTime = resultSet.getTimestamp(1,
Calendar.getInstance(TimeZone.getTimeZone("UTC"))).getTime();
+ final long currentTimeNoMillis = stripMilliseconds(currentTime);
+ if (currentTimeNoMillis < startTime) {
Review comment:
Shouldn't this method be called something like
`verifyAndGetDatabaseCurrentTimestampInUTC` to better reflect the internal
logic?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]