Comments (9)
Related #53
from jaeger-client-cpp.
RemoteReport::close()
makes no effort to flush by the looks:
void RemoteReporter::close()
{
{
std::unique_lock<std::mutex> lock(_mutex);
if (!_running) {
return;
}
_running = false;
lock.unlock();
_cv.notify_one();
}
_thread.join();
}
from jaeger-client-cpp.
It probably makes sense to log dropped buffers on close instead, with a hint that an explicit flush before close is advised (using #53 for flush). But that'd really want the opentracing API to adopt the Flush method.
from jaeger-client-cpp.
The Close
method is meant to be optional; so if you don't want to wait on the tracer to flush all it's spans you can just not call it.
I think the right solution is for jaeger to move the current code in close
to its destructor and change close
to flush the spans, but require it to be called explicitly.
from jaeger-client-cpp.
@rnburn Makes sense. I'll amend my push that adds an optional Tracer.flush()
to Jaeger's tracer so that it also calls it on explicit Close()
, but from the dtor.
@isaachier I've written a small test program to reproduce this bug. It reliably loses spans. ringerc@2a36dd5 (on master) or ringerc@ff654d9 (on my fix/feature integration branch, but not using flush).
jaegertracing::Tracer::flush()
does not seem to be working/sufficient. If you uncomment
//static_cast<jaegertracing::Tracer*>(tracer.get())->flush();
in src/jaegertracing/shortlived.cpp
, it still often loses spans. Wireshark will show that the span was never sent.
from jaeger-client-cpp.
Additional test runs show that without flush()
it loses spans pretty much 100% of the time.
If I uncomment flush()
on my integration test branch it often takes several seconds to exit so I'm not waking a thread properly or something.
Anyway, current behaviour clearly broken.
from jaeger-client-cpp.
I pushed an improved test case (ringerc@e5a6234). It clearly shows that we lose spans unless:
- We explicitly
flush()
with./src/jaegertracing/shortlived "" 1
and the flush actually works (per below) - We sleep > 10 seconds with
./src/jaegertracing/shortlived "" 0 11
The flush must actually take effect. Sometimes it seems to get missed;
Test with opname "shortlived--flush-sleep0s, flush 1
flushing... flushed (flush took 0ms)
not sleeping before exit
in which case the span is also lost. So there's something wrong with my flush method. Locking issues?
Lowering the configured bufferFlushInterval
reduces the necessary sleep, it's obviously an issue with not waking the flush thread properly.
@isaachier I could use advice at this point, my C++ and threading is ... limited.
I also have no idea how to integrate this into the regression tests. Crossdock somehow?
from jaeger-client-cpp.
In general there might be a problem with blocking IO and threading. I'm about to call it a night, but will try to look at this tomorrow. Worst case, will be able to look over the weekend.
from jaeger-client-cpp.
I think I have a simpler approach for this specific issue. About the flush method being exposed overall, that can be a new PR. See #59 for first fix.
from jaeger-client-cpp.
Related Issues (20)
- Provide access to context HTTP Header name
- Jaeger 32 bit C/C++ client required
- QUESTION: Can not use with hunter manager
- how to release version to real scene
- Unit test: Socket.testFailBind fails when run as "root" HOT 6
- Can we please ditch hunter HOT 1
- Enable ppc64le arch for jaeger-client-cpp
- Unable to build windows in a pipeline.
- Add support for adding tracer tags via config yaml HOT 1
- My jaeger version is 1.23, and the jaeger-collector component has enabled --sampling.strategies-reload-interval, but the collected logs show that the sampling strategy is still old HOT 4
- Envoy - failed to load dynamic library opentracing versions are incomptable
- `RemoteReporter::report()` is blocked
- Default queue size & buffer flush interval are not used when reading configuration from YAML
- Issue facing while trying to build jaeger-client-cpp
- Compilation issue on Ubuntu 20.04 HOT 2
- When the sampling type is rate, the number of actual results is equal to the number of threads multiplied by the configured rate parameter
- warning const' was hidden [-Woverloaded-virtual] when using jaeger client with opentracing libraries
- Enablement TravisCI integration for IBM ppc64le architecture HOT 1
- Deprecate Jaeger C++ SDK HOT 3
- [Bug]: W3C Propagation is wrongfully encoding debug span flag into traceparent HOT 1
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 jaeger-client-cpp.