keith-turner commented on issue #4756:
URL: https://github.com/apache/accumulo/issues/4756#issuecomment-2251299058
> Is there a good way to determine which scan threads are running zombie
scans?
Not that I know of, I think some new code would need to be written. We
currently have Session objects that can get to a scan thread, but the session
objects may be removed. Tablets have an activeScans set that may offer a way
to find threads, however if #4757 is implemented then Tablet objects could be
removed. So once the Tablet and Session are removed (no longer tracked by the
tablet server) then a zombie scan thread would have nothing referencing it in
the tablet server except for maybe the thread pool.
We could add a tablet server level tracking object like the following.
Scans threads could add/remove their self in a try/finally block.
Periodically we could all countZombieScans() and update a gauge w/ the count.
```java
// track the running scans in the tablet server
class RunningScans {
Set<ScanSession> runningScans = new HashSet<>();
// TODO could return closeable that does the removal, would work well w/
try with resources
public sync void addScan(ScanSession scanSession) {
runningScans.add(scanSession);
}
public sync void removeScan(ScanSession scanSession) {
runningScans.remove(scanSession);
}
public sync int countZombieScans(){
return
runningScans.stream().filter(scanSessions->scanSession.state==REMOVED).count();
}
}
```
--
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]