You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "dlmarion (via GitHub)" <gi...@apache.org> on 2026/01/16 15:25:05 UTC
[I] Create a cleanup utility [accumulo-classloaders]
dlmarion opened a new issue, #45:
URL: https://github.com/apache/accumulo-classloaders/issues/45
This offers the building blocks to create a cleanup utility and leave that as an exercise to the reader. It would probably be best (in a follow on change) to write a cleanup utility in this project that uses these building blocks, for the following reasons.
* Can document and test the cleanup code in one place. If cleanup code is written, seems suboptimal for it to live in another repo or for there to be multiple implementions.
* Having a working end to end impl gives confidence that these building blocks provide everything that is needed to do cleanup.
* The cleanup code will need to have some awareness of the directory layout of the cache dir which is an internal implementation detail.
* The clean up utility will have to get the algorithm correct in order to avoid race conditions. Seems like its important to list the dir first prior to get refs from all processes, but not completely sure. Would need to experiment and see the code to be sure.
* Could make the cleanup code more robust by failing properly if no JMX seen or mismatch in dir passed in and dirs seen from jmx.
We could make the new command line utility have subcommands to support this. Something like the following.
```
accumulo context-classloader --help
# create context definition json and print to stdout
accumulo context-classloader create -i <interval> -f {files}
# remove files not in use by any of the given pids
accumulo context-classloader cleanup <cache dir> {pids}
```
_Originally posted by @keith-turner in https://github.com/apache/accumulo-classloaders/pull/33#discussion_r2695416209_
--
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: notifications-unsubscribe@accumulo.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Create a cleanup utility [accumulo-classloaders]
Posted by "ctubbsii (via GitHub)" <gi...@apache.org>.
ctubbsii commented on issue #45:
URL: https://github.com/apache/accumulo-classloaders/issues/45#issuecomment-3848225697
This is no longer needed after #58, since it is easier to remove resources or other files when one wishes, provided that files/dirs with PID in them don't get deleted when the process with that PID is still running.
--
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: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Create a cleanup utility [accumulo-classloaders]
Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on issue #45:
URL: https://github.com/apache/accumulo-classloaders/issues/45#issuecomment-3762126753
There was discussion in the original comment thread about finding a JMX client library to use in an end-to-end example utility. Just adding this to the discussion - I came across Jolokia, which can be set a a javaagent on a JVM that then exposes JMX MBeans via an HTTP interface. I was able to test this very easily by doing the following:
1. Downloading the agent jar (https://search.maven.org/remotecontent?filepath=org/jolokia/jolokia-agent-jvm/2.4.2/jolokia-agent-jvm-2.4.2-javaagent.jar)
2. Adding the following in the tserver options in accumulo-env.sh: `-javaagent:/path/to/agent.jar=port=7777,host=localhost`
3. Then using a browser to make the following HTTP request: `http://localhost:7777/jolokia/read/org.apache.accumulo.classloader:type=ContextClassLoaders`.
This resulted in the following response:
```
{
"request": {
"mbean": "org.apache.accumulo.classloader:type=ContextClassLoaders",
"type": "read"
},
"value": {
"ReferencedFiles": {
"file:///tmp/contexts.json-c1f19a8a3b1864fcec75464ececbde919bc834e8128b72ce35d20bbdbd72a211": [
"file:/tmp/contexts/resources/example-iterators-a-1.0.0-SNAPSHOT-337fe466c1cf0f6299e468b581300d760b9c29940e007134de61246138e53164.jar"
]
},
"ObjectName": {
"objectName": "org.apache.accumulo.classloader:type=ContextClassLoaders"
}
},
"status": 200,
"timestamp": 1768603278
}
```
Relevant links:
https://jolokia.org/reference/html/manual/agents.html#agents-jvm
https://jolokia.org/reference/html/manual/jolokia_protocol.html#get-requests
--
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: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Create a cleanup utility [accumulo-classloaders]
Posted by "ctubbsii (via GitHub)" <gi...@apache.org>.
ctubbsii closed issue #45: Create a cleanup utility
URL: https://github.com/apache/accumulo-classloaders/issues/45
--
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: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org