InMemoryRegistrationStore#addObservation doesn't add the observation
See original GitHub issueThe current code is not adding the observation to the internal data structure, this scenario is not covered in the tests.
As you can see in the current code, the existing observations are being removed and the new observation is not being added:
try {
lock.writeLock().lock();
// cancel existing observations for the same path and registration id.
for (Observation obs : unsafeGetObservations(registrationId)) {
if (observation.getPath().equals(obs.getPath()) && !Arrays.equals(observation.getId(), obs.getId())) {
unsafeRemoveObservation(obs.getId());
removed.add(obs);
}
}
} finally {
lock.writeLock().unlock();
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Enabling Objects for In-Memory Population Manually
If INMEMORY_AUTOMATIC_LEVEL is not set to HIGH, then you must manually enable and disable objects for population and set compression and priority options....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I added some tests about that and found some minor issues about “context”. #430
My apologizes, I got confused with how the observations worked, there was a silly mistake in my code.
Thanks.