Comments (7)
I just noticed the zorka logfile gets a new entry every time a filter applies/matches:
2015-03-26 11:44:26 INFO DispatchingSubmitter Submission thread local stack mismatch (ctx=com.jitlogic.zorka.core.spy.SpyContext@6dc65da5, stage=2, submitFlags=2)
Then, I saw some TODO comment in the DispatchingSubmitter:
"TODO what happens to submission stack when spy context disappears when some method is executing ?"
Does that mean, there's no implementation for this case yet?
Is it safe to just uncomment the logging code for now (to prevent spammy entries in the logs) or are there other consequences of this behaviour?
from zorka.
Ah thank you. Unfortunately when I was implementing ComparatorProcessor I tried to be "clever" and this resulted in unreadable mess that is now bringing such nasty bugs you've discovered. Now I'm integrating your fix into mainline codebase, maybe later on I'll try to rethink and rewrite this piece into a more decent form :)
Thanks (and sorry for delayed answer).
from zorka.
Regarding DispatchingSubmitter: in principle this situation should not happen. At the beginning of each instrumented method [.onEnter()] a newly created context object is put onto stack. On return [.onReturn(),.onError(),.onSubmit()] context is popped out of the stack, so information grabbed at method entry can be reused after method execution. There is a bunch of corner cases as well, for example you can have only .onEnter() chain defined, so only method entry will be instrumented. This is somewhat delicate situation as one needs to keep context stack in sync with instrumented code execution. Agent tries to handle such cases as well (at least those I've envisioned or encountered) but no one says there are no additional ones. In order not to break monitored code, spy cannot just crash - it handles such 'unexpected' situations (that shouldn't happen) by issuing log message. It might be either a bug in intrumentation engine itself or beanshell instrumentation definitions (or even BSH functions when used inside instrumentation chains). For me this indicates that the particular case you've encountered should be isolated and debugged. Ignoring these messages will lead to a number of dropped (or only partially executed) monitorings of instrumented method.
from zorka.
Thanks for your reply.
In my case, this log message shows up, every time my vcmp filter matches:
.onEnter(
spy.fetchArg("THIS", 0),
spy.get( "CLASSNAME", "THIS", "class", "name"),
//vcmp code below causes log entry, if filter matches
spy.vcmp( "CLASSNAME", spy.NE, "com.sun.jersey.spi.container.servlet.ServletContainer"),
//some more code here...
)
I am instrumenting:
.include(spy.byMethod( "javax.servlet.http.HttpServlet", "service"))
from zorka.
So here we are. If spy.vcmp(...) stops .onEnter() chain (and that's how filters work - they stop chain execution), it will result in context not being pushed onto stack. Try something like this:
.onEnter(
spy.fetchArg("THIS", 0),
spy.get( "CLASSNAME", "THIS", "class", "name"),
spy.subchain(
//vcmp code below causes log entry, if filter matches
spy.vcmp( "CLASSNAME", spy.NE, "com.sun.jersey.spi.container.servlet.ServletContainer"),
//some more code here...
)
)
Function spy.subchain() will group another elements into a (sub-)chain that will return context even if chain execution will be stopped.
from zorka.
Every time you do some kind of filtering in .onEnter() and then have either .onReturn(), .onError() or .onSubmit() defined, you need to be careful about always returning something. Maybe I should handle this case more gracefuly (eg. push null into stack - to ensure that exit chains won't execute in more controlled way).
from zorka.
Works like a charm, thank you!
from zorka.
Related Issues (20)
- Active agent items are flapping between supported/not supported state HOT 1
- Jeus Server HOT 1
- Need the descriptions of Method Trace Metrics header HOT 1
- zorka.log.dir property value not working
- Allow path to a specific zorka.properties file in zorka agent path. HOT 1
- Zabbix active checks done in discovery mode do not work. HOT 2
- Wildfly/Tomcat won't start if zorka can't resolve zabbix active server name HOT 1
- TLS support HOT 2
- Prevent instrumentation - act just like a bridge b/w Zabbix and JMX HOT 3
- java.lang.OutOfMemoryError: GC overhead limit exceeded HOT 6
- Zorka compatibility with SDK 1.7 (Websphere) HOT 1
- Jboss templates WebSessions and JBossCacheManager HOT 1
- SpyFlagsProcessor logic error? HOT 1
- Zabbix Agent is not responding after upgrade to Zabbix 4.0 HOT 4
- zorka was password not encripted
- zabbix 5.x HOT 3
- I can't understand exact way how to connect zabbix and zorka
- Can't get data from springboot acturator through jmx HOT 1
- Unsupported class file major version 61
- Error while adding agent to IBM WebSphere 8.5.5.16
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 zorka.