Comments (13)
The OpenShift part should not affect this code pathway, this should be fully reproducible locally with ex. the Cryostat smoketest.sh
script.
What's happening is that when Cryostat discovers a JVM, it tries to connect to that JVM and hash some MBean attributes to generate a fingerprint ID of that JVM. It uses this fingerprint when doing things like storing archived recordings for that JVM, so that if you have two or more different URLs that resolve to the same actual JVM process, you can see the same data across those different URLs.
from cryostat-core.
The -agent also goes through this same code pathway when it's figuring out its fingerprint ID which it publishes to Cryostat when it does its discovery updates, so fixing this bug in -core
will fix the problem on both sides.
from cryostat-core.
Yep, that's what I thought when I was originally working with Janelle to implement this hashing technique. I don't think the JVM generally has any exposed unique ID like this, at least not one that we can retrieve over JMX/MBean. Even the PID isn't likely to be helpful in containers.
I wonder if the hostname or primary interface IP can be pulled from somewhere?
from cryostat-core.
Otherwise, if this is not fully solvable in the case where Cryostat determines the fingerprint ID by connecting to the JVM over JMX, it's still solvable in the case where the Agent is present and determines its own ID to publish to Cryostat. We can just forego the whole MBean attribute collection stuff there and simply generate a UUID. This could be a technical reason for users deploying very horizontally scaled applications to use the Agent, rather than the classic Cryostat+JMX.
from cryostat-core.
@roberttoyonaga are there any other MBean attributes you think would make sense to add in to that hash? We could simply skip anything that is null
and cannot be retrieved in cases like SubstrateVM, and then check that the DataOutputStream
is not empty before hashing it (and throw some informative exception if it is empty), but I worry that eliminating too many of these attributes may lead to hash collisions in practice because there just isn't enough input differentiation.
from cryostat-core.
are there any other MBean attributes you think would make sense to add in to that hash
Hmm maybe you could try OperatingSystemMXBean.Arch, OperatingSystemMXBean.Name, RuntimeMXBean.Pid, RuntimeMXBean.SpecVersion, RuntimeMXBean.VmName. I just tried these out on quarkus native connecting with JMC. These are all non-null and constant for the life of the process in SubstrateVM.
from cryostat-core.
Also, RuntimeMXBean.StartTime is implemented for SubstrateVM (and you already include that in the hash). So that should be a big help in differentiating between "JVMs"
from cryostat-core.
Yea, that's one of the key ones for sure, though it's "only" millisecond resolution and so I wonder if it can still be a problem in a container orchestration environment where a deployment is scaled up and several replicas are started. I suppose it depends heavily on the cluster/node doing that work, but might more than one container come up with the same millisecond timestamp? Hmm.
from cryostat-core.
Right, that's a good point. In that sort of scenario most of the other attributes will be shared as well :(
from cryostat-core.
I wonder if the hostname or primary interface IP can be pulled from somewhere?
Not sure about this. Off the top of my head I haven't seen anywhere this might be accessible via RJMX.
from cryostat-core.
By skipping attributes that are null, I am able to see the GraalVM native image in the topology view. However, a new error presents itself after selecting it as the target in the recordings view:
from cryostat-core.
I think there should be a longer/more informative corresponding stack trace in the Cryostat server logs when that happens. Could you post it here as well?
from cryostat-core.
Actually, you could post that in the PR you've opened.
from cryostat-core.
Related Issues (20)
- [Task] Add status checks for new workflows
- Spotless fails build after update to 4.8.1 HOT 2
- Rename AgentJmxHelper to reflect *JMC* Agent more accurately
- [Task] Replace JSoup with Jackson HOT 2
- [Bug] On release, duplicate attempts to build and publish mvn package HOT 1
- [Bug] JMC and `jdk.jfr` models of `RecordingState` differ
- [Bug] CI is not correctly caching the PR's -core version HOT 1
- [Task] CI should build cryostat3 as well as cryostat (2.x)
- [Task] CI should publish test images of 3.0
- [Bug] CI failing to build Cryostat3
- [Task] Remove `LocalStorageTemplateService`
- [Task] CI should build Cryostat 3.0, not 2.x HOT 1
- [Task] Add Jandex plugin to build
- [Task] Define bean type to replace `java.lang.management.MemoryUsage`
- [Bug] EventTypeMetadataV2 embedded source fork is outdated HOT 1
- [Bug] Moving tag early-access causing issues for repository mirroring
- Split implementations from interfaces and simple models
- [CI] `libcryostat` should not only target JDK 11, but should be built with JDK 11 HOT 1
- [Bug] JFR operations require MissionControlMXBean HOT 1
- [Bug] JMC Agent Probe Template schema is in the wrong package HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cryostat-core.