Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

Possible bug with adding up message counts? #16

Open
aliostad opened this issue Feb 11, 2017 · 6 comments · Fixed by #17
Open

Possible bug with adding up message counts? #16

aliostad opened this issue Feb 11, 2017 · 6 comments · Fixed by #17

Comments

@aliostad
Copy link
Collaborator

This code looks like a bug to me but not sure the intended purpose hence asking:

countSinceCheckpoint += buffer.size();

https://github.com/openzipkin/zipkin-azure/blob/master/collector/eventhub/src/main/java/zipkin/collector/eventhub/ZipkinEventProcessor.java#L70

So let's say we have 5 spans in first message and 6 in the second, my countSinceCheckpoint will be 16 (5+11) rather than 11. I think just comparing with buffer.size() should be enough.

@codefromthecrypt
Copy link

codefromthecrypt commented Feb 12, 2017 via email

@codefromthecrypt
Copy link

ps I have work in progress on this. The SDK is a bit of a bear to work with as it is signed, etc, which makes it hard to mock certain things.

@codefromthecrypt
Copy link

#17

@codefromthecrypt
Copy link

cutting as 0.1.2 since I presume not checkpointing properly is a fairly major bug!

@aliostad thanks for discovering this

@aliostad aliostad reopened this Feb 13, 2017
@aliostad
Copy link
Collaborator Author

aliostad commented Feb 13, 2017

I am sorry I have to open this issue again, since the problem is closely related to the same code.

It is not really our fault (I believe MS samples are wrong too) but basically the host creates a single IEventProcessor (in our case ZipkinEventProcessor) but the onEvents gets called per each partition, on different threads. Hence keeping a single count for ZipkinEventProcessor does not cut it.

Let me raise this with Microsoft before making any changes but my understanding is to keep a thread-safe dictionary of counts to solve.

@codefromthecrypt
Copy link

codefromthecrypt commented Feb 13, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants