[jira] [Commented] (SOLR-12611) Add version information to thread dump
[ https://issues.apache.org/jira/browse/SOLR-12611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16567048#comment-16567048 ] Shawn Heisey commented on SOLR-12611: - New patch that does the wait() in a truly endless loop. Before starting the thread, daemon is enabled. Testing (on Windows 7) indicates that the JVM stops immediately, doesn't need to be hard-killed. CHANGES.txt addition also present. > Add version information to thread dump > -- > > Key: SOLR-12611 > URL: https://issues.apache.org/jira/browse/SOLR-12611 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Affects Versions: 7.4 >Reporter: Shawn Heisey >Priority: Trivial > Attachments: SOLR-12611.patch, SOLR-12611.patch > > > Thread dumps contain stacktrace info. Without knowing the Solr version, it > can be difficult to compare stacktraces to source code. > If exact version information is available in the thread dump, it will be > possible to look at source code to understand stacktrace information. If > *full* version information is present, then it would even be possible to > learn whether the user is running an official binary build or if they have > built Solr themselves. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-12611) Add version information to thread dump
[ https://issues.apache.org/jira/browse/SOLR-12611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16566953#comment-16566953 ] Dawid Weiss commented on SOLR-12611: bq. I wanted to make sure that the loop can exit quickly when the run flag goes false. It should be flag + long sleep + interrupt to recheck the condition. > Add version information to thread dump > -- > > Key: SOLR-12611 > URL: https://issues.apache.org/jira/browse/SOLR-12611 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Affects Versions: 7.4 >Reporter: Shawn Heisey >Priority: Trivial > Attachments: SOLR-12611.patch > > > Thread dumps contain stacktrace info. Without knowing the Solr version, it > can be difficult to compare stacktraces to source code. > If exact version information is available in the thread dump, it will be > possible to look at source code to understand stacktrace information. If > *full* version information is present, then it would even be possible to > learn whether the user is running an official binary build or if they have > built Solr themselves. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-12611) Add version information to thread dump
[ https://issues.apache.org/jira/browse/SOLR-12611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16566916#comment-16566916 ] Shawn Heisey commented on SOLR-12611: - The reason that the sleep was so short in my alternate code was because I wanted to make sure that the loop can exit quickly when the run flag goes false. My overall knowledge did not include information like daemon threads. After looking that up, it sounds like a great idea, and simplifies the code. Thanks for the info! My motivation here is from the perspective of helping people with Solr problems. I've seen situations where users do think of sending a stacktrace, but do not mention which version of Solr they're running. Asking for missing information can mean a long delay in figuring out the problem. > Add version information to thread dump > -- > > Key: SOLR-12611 > URL: https://issues.apache.org/jira/browse/SOLR-12611 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Affects Versions: 7.4 >Reporter: Shawn Heisey >Priority: Trivial > Attachments: SOLR-12611.patch > > > Thread dumps contain stacktrace info. Without knowing the Solr version, it > can be difficult to compare stacktraces to source code. > If exact version information is available in the thread dump, it will be > possible to look at source code to understand stacktrace information. If > *full* version information is present, then it would even be possible to > learn whether the user is running an official binary build or if they have > built Solr themselves. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-12611) Add version information to thread dump
[ https://issues.apache.org/jira/browse/SOLR-12611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16566467#comment-16566467 ] Dawid Weiss commented on SOLR-12611: If it's just going to stay dormant, then I'd say object wait is a fine solution. Or a Thread.sleep() with a large constant (why 100 millis if it can be 24 hours...). I'd also make this thread a daemon thread so that the JVM can terminate without even looking at it (and the test framework doesn't consider it a live thread escaping the test?). Also, I was just pointing out the fact, I'm not saying this is the right solution to the problem. I understand your rationale, but if somebody can dump a stack trace of all threads they can as well inspect the classpath (even that of a running process) and get Solr's version from there? On the other hand, if it helps with diagnostics, a dormant thread doesn't seem to hurt anybody much. > Add version information to thread dump > -- > > Key: SOLR-12611 > URL: https://issues.apache.org/jira/browse/SOLR-12611 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Affects Versions: 7.4 >Reporter: Shawn Heisey >Priority: Trivial > Attachments: SOLR-12611.patch > > > Thread dumps contain stacktrace info. Without knowing the Solr version, it > can be difficult to compare stacktraces to source code. > If exact version information is available in the thread dump, it will be > possible to look at source code to understand stacktrace information. If > *full* version information is present, then it would even be possible to > learn whether the user is running an official binary build or if they have > built Solr themselves. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-12611) Add version information to thread dump
[ https://issues.apache.org/jira/browse/SOLR-12611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16565979#comment-16565979 ] Shawn Heisey commented on SOLR-12611: - Maybe I should combine the two approaches. A boolean to control exit, and the wait() call. Deal with any possible spurious problems -- interrupts or wakeups. Also avoid any inefficiencies from lots of short sleeps. Testing this now, will put up a new patch if I see signs of success. > Add version information to thread dump > -- > > Key: SOLR-12611 > URL: https://issues.apache.org/jira/browse/SOLR-12611 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Affects Versions: 7.4 >Reporter: Shawn Heisey >Priority: Trivial > Attachments: SOLR-12611.patch > > > Thread dumps contain stacktrace info. Without knowing the Solr version, it > can be difficult to compare stacktraces to source code. > If exact version information is available in the thread dump, it will be > possible to look at source code to understand stacktrace information. If > *full* version information is present, then it would even be possible to > learn whether the user is running an official binary build or if they have > built Solr themselves. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-12611) Add version information to thread dump
[ https://issues.apache.org/jira/browse/SOLR-12611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16565935#comment-16565935 ] Shawn Heisey commented on SOLR-12611: - Thanks for looking, [~dweiss]! I'm not well-versed in how to properly handle this kind of code. Your change would be easy. I did have a different idea that I considered, which might be even more bulletproof, but it's probably less efficient. It would involve an AtomicBoolean object and this code in the thread: {code:java} while (versionThreadRun.get()) { try { Thread.sleep(100); } catch (InterruptedException e) { } } {code} I figure there are two criteria to satisfy with the "do nothing" implementation, and I'm not sure what the best options are: 1) Code must be bulletproof. 2) Code must use as little CPU and memory as possible. > Add version information to thread dump > -- > > Key: SOLR-12611 > URL: https://issues.apache.org/jira/browse/SOLR-12611 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Affects Versions: 7.4 >Reporter: Shawn Heisey >Priority: Trivial > Attachments: SOLR-12611.patch > > > Thread dumps contain stacktrace info. Without knowing the Solr version, it > can be difficult to compare stacktraces to source code. > If exact version information is available in the thread dump, it will be > possible to look at source code to understand stacktrace information. If > *full* version information is present, then it would even be possible to > learn whether the user is running an official binary build or if they have > built Solr themselves. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-12611) Add version information to thread dump
[ https://issues.apache.org/jira/browse/SOLR-12611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16565893#comment-16565893 ] Dawid Weiss commented on SOLR-12611: That wait() isn't right -- the contract for wait() allows spurious wakeups, so it should be {code} while (true) { obj.wait(); } {code} with an interrupted exception handler either inside breaking out of the loop or outside, falling-through. > Add version information to thread dump > -- > > Key: SOLR-12611 > URL: https://issues.apache.org/jira/browse/SOLR-12611 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Affects Versions: 7.4 >Reporter: Shawn Heisey >Priority: Trivial > Attachments: SOLR-12611.patch > > > Thread dumps contain stacktrace info. Without knowing the Solr version, it > can be difficult to compare stacktraces to source code. > If exact version information is available in the thread dump, it will be > possible to look at source code to understand stacktrace information. If > *full* version information is present, then it would even be possible to > learn whether the user is running an official binary build or if they have > built Solr themselves. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-12611) Add version information to thread dump
[ https://issues.apache.org/jira/browse/SOLR-12611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16565890#comment-16565890 ] Shawn Heisey commented on SOLR-12611: - Attached patch against branch_7x that creates a thread on startup. The thread is given a name that includes full version information. The thread is set up to wait on synchronization, which I figure is probably the most efficient way for a thread to do absolutely nothing. If there's a better option, let me know. At Solr shutdown, the thread is sent an interrupt, which breaks it out of its synchronization wait and allows the thread to end. > Add version information to thread dump > -- > > Key: SOLR-12611 > URL: https://issues.apache.org/jira/browse/SOLR-12611 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Affects Versions: 7.4 >Reporter: Shawn Heisey >Priority: Trivial > Attachments: SOLR-12611.patch > > > Thread dumps contain stacktrace info. Without knowing the Solr version, it > can be difficult to compare stacktraces to source code. > If exact version information is available in the thread dump, it will be > possible to look at source code to understand stacktrace information. If > *full* version information is present, then it would even be possible to > learn whether the user is running an official binary build or if they have > built Solr themselves. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org