lebron374 opened a new issue #2094:
URL: https://github.com/apache/rocketmq/issues/2094
```
public abstract class ReferenceResource {
protected final AtomicLong refCount = new AtomicLong(1);
protected volatile boolean available = true;
protected volatile boolean cleanupOver = false;
private volatile long firstShutdownTimestamp = 0;
public synchronized boolean hold() {
if (this.isAvailable()) {
if (this.refCount.getAndIncrement() > 0) {
return true;
} else {
this.refCount.getAndDecrement();
}
}
return false;
}
public boolean isAvailable() {
return this.available;
}
public void shutdown(final long intervalForcibly) {
if (this.available) {
this.available = false;
this.firstShutdownTimestamp = System.currentTimeMillis();
this.release();
} else if (this.getRefCount() > 0) {
if ((System.currentTimeMillis() - this.firstShutdownTimestamp)
>= intervalForcibly) {
// some confusion here
this.refCount.set(-1000 - this.getRefCount());
this.release();
}
}
}
```
this.refCount.set(-1000 - this.getRefCount())
should replace by
this.refCount.set(-1000 + this.getRefCount());
i think the purpose is every time decreate by 1000 until 0
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]