question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

InMemoryRegistrationStore#addObservation doesn't add the observation

See original GitHub issue

The 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:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sbernard31commented, Nov 10, 2017

I added some tests about that and found some minor issues about “context”. #430

0reactions
AlexITCcommented, Nov 9, 2017

My apologizes, I got confused with how the observations worked, there was a silly mistake in my code.

Thanks.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found