File tree Expand file tree Collapse file tree 4 files changed +8
-5
lines changed
src/main/java/com/actiontech/dble Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,9 @@ public synchronized void closeImmediately(final String reason) {
170
170
private void closeImmediatelyInner (String reason ) {
171
171
if (isClosed .compareAndSet (false , true )) {
172
172
if (service instanceof BusinessService ) {
173
- ((BusinessService ) service ).controlTx (TransactionOperate .QUIT );
173
+ BusinessService bService = (BusinessService ) service ;
174
+ bService .addHisQueriesCount ();
175
+ bService .controlTx (TransactionOperate .QUIT );
174
176
AbstractTrackProbe .trace (service , t -> t .setExit ());
175
177
}
176
178
FrontActiveRatioStat .getInstance ().remove (this );
Original file line number Diff line number Diff line change 13
13
import com .actiontech .dble .net .mysql .EOFPacket ;
14
14
import com .actiontech .dble .net .service .AuthResultInfo ;
15
15
import com .actiontech .dble .server .variables .MysqlVariable ;
16
+ import com .actiontech .dble .singleton .TsQueriesCounter ;
16
17
import com .actiontech .dble .statistic .CommandCount ;
17
18
18
19
import java .util .concurrent .atomic .AtomicLong ;
@@ -49,6 +50,10 @@ public void resetCounter() {
49
50
queriesCounter .set (Long .MIN_VALUE );
50
51
}
51
52
53
+ public void addHisQueriesCount () {
54
+ TsQueriesCounter .getInstance ().addToHistory (this );
55
+ }
56
+
52
57
public void executeContextSetTask (MysqlVariable [] contextTask ) {
53
58
MysqlVariable autocommitItem = null ;
54
59
for (MysqlVariable variable : contextTask ) {
Original file line number Diff line number Diff line change 41
41
import com .actiontech .dble .services .mysqlauthenticate .MySQLChangeUserService ;
42
42
import com .actiontech .dble .singleton .SerializableLock ;
43
43
import com .actiontech .dble .singleton .TraceManager ;
44
- import com .actiontech .dble .singleton .TsQueriesCounter ;
45
44
import com .actiontech .dble .util .SplitUtil ;
46
45
import com .actiontech .dble .util .exception .NeedDelayedException ;
47
46
import com .alibaba .druid .wall .WallCheckResult ;
@@ -573,7 +572,6 @@ public void multiStatementNextSql(boolean flag) {
573
572
@ Override
574
573
public void cleanup () {
575
574
super .cleanup ();
576
- TsQueriesCounter .getInstance ().addToHistory (this );
577
575
session .terminate ();
578
576
if (getLoadDataInfileHandler () != null ) {
579
577
getLoadDataInfileHandler ().clear ();
Original file line number Diff line number Diff line change 34
34
import com .actiontech .dble .services .mysqlauthenticate .MySQLChangeUserService ;
35
35
import com .actiontech .dble .services .rwsplit .handle .PreparedStatementHolder ;
36
36
import com .actiontech .dble .singleton .TraceManager ;
37
- import com .actiontech .dble .singleton .TsQueriesCounter ;
38
37
import com .alibaba .druid .wall .WallCheckResult ;
39
38
import com .alibaba .druid .wall .WallProvider ;
40
39
import org .jetbrains .annotations .NotNull ;
@@ -465,7 +464,6 @@ public void resetConnection() {
465
464
public void cleanup () {
466
465
super .cleanup ();
467
466
if (session != null ) {
468
- TsQueriesCounter .getInstance ().addToHistory (this );
469
467
session .close ("clean up" );
470
468
}
471
469
}
You can’t perform that action at this time.
0 commit comments