CRZbulabula commented on code in PR #16520:
URL: https://github.com/apache/iotdb/pull/16520#discussion_r2390500834
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/session/SessionManager.java:
##########
@@ -316,7 +347,38 @@ public boolean closeSession(IClientSession session,
LongConsumer releaseByQueryI
String.valueOf(session.getId()));
// TODO we only need to do so when query is killed by time out close the
socket.
IClientSession session1 = currSession.get();
- return session1 == null || session == session1;
+ if (session1 != null && session != session1) {
+ // AUDIT_LOGGER.log(
+ // new AuditLogFields(
+ // session.getUserId(),
+ // session.getUsername(),
+ // session.getClientAddress(),
+ // AuditEventType.LOGOUT,
+ // AuditLogOperation.CONTROL,
+ // false),
+ // () ->
+ // String.format(
+ // "The client-%s is trying to close another session
%s, pls check if it's a
+ // bug",
+ // session, session1));
+ LOGGER.info(
+ String.format(
+ "The client-%s is trying to close another session %s, pls check
if it's a bug",
+ session, session1));
+ return false;
+ } else {
+ // AUDIT_LOGGER.log(
+ // new AuditLogFields(
+ // session.getUserId(),
+ // session.getUsername(),
+ // session.getClientAddress(),
+ // AuditEventType.LOGOUT,
+ // AuditLogOperation.CONTROL,
+ // true),
+ // () -> String.format("Session-%s is closing", session));
Review Comment:
Remove them.
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/session/SessionManager.java:
##########
@@ -453,6 +515,16 @@ public TimeZone getSessionTimeZone() {
public void removeCurrSession() {
IClientSession session = currSession.get();
if (session != null) {
+ // TODO: Enable logout audit after reconstruct session logout management
+ // AUDIT_LOGGER.log(
+ // new AuditLogFields(
+ // session.getUserId(),
+ // session.getUsername(),
+ // session.getClientAddress(),
+ // AuditEventType.LOGOUT,
+ // AuditLogOperation.CONTROL,
+ // true),
+ // () -> String.format("Session-%s is closed", session));
Review Comment:
Remove them.
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/session/SessionManager.java:
##########
@@ -316,7 +347,38 @@ public boolean closeSession(IClientSession session,
LongConsumer releaseByQueryI
String.valueOf(session.getId()));
// TODO we only need to do so when query is killed by time out close the
socket.
IClientSession session1 = currSession.get();
- return session1 == null || session == session1;
+ if (session1 != null && session != session1) {
+ // AUDIT_LOGGER.log(
+ // new AuditLogFields(
+ // session.getUserId(),
+ // session.getUsername(),
+ // session.getClientAddress(),
+ // AuditEventType.LOGOUT,
+ // AuditLogOperation.CONTROL,
+ // false),
+ // () ->
+ // String.format(
+ // "The client-%s is trying to close another session
%s, pls check if it's a
+ // bug",
+ // session, session1));
Review Comment:
Remove them.
--
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]