You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Lars Francke <la...@gmail.com> on 2018/08/16 03:46:47 UTC

Debugging HBase

Hi everyone,

this might sound like a stupid question but how do you go about debugging
HBase? (With the Java debugger I mean)

I use IntelliJ to attach to the running Master or RegionServer as needed,
set breakpoints etc.

But every time I do so the connection to ZK times out and Master or RS are
declared dead. I _always_ forget to set the timeout high enough.

I'm using IntelliJ.

Are you doing anything differently? Is there a way to not pause all threads
when debugging so the heartbeats to ZK keep on going?

Thanks,
Larss

Re: Debugging HBase

Posted by Lars Francke <la...@gmail.com>.
Not going to comment on the "old dog" ;-)

But yeah...almost everyone I meet is using IntelliJ and I _believe_ that
one of the differences between the two is that Eclipse by default only
suspends a single thread while IntelliJ by default suspends the whole app.
I'll try to test it. And if I find something I'll add it to the book.

On Mon, Aug 20, 2018 at 10:19 PM, Josh Elser <el...@apache.org> wrote:

> I'm on Eclipse, but I think I'm an "old dog" for not having switched over
> by now ;). To my knowledge, more devs are using Intellij than Eclipse/other.
>
> If you stumble onto anything that would be good for other devs, I think
> that would be a nice addition to the HBase book.
>
>
> On 8/19/18 2:43 PM, Lars Francke wrote:
>
>> Thanks Josh, are you using IntelliJ or Eclipse?
>>
>> This is one of those things that has annoyed me for a while but I never
>> really bothered to look at it in detail, your comment made me do it.
>>
>> I think IntelliJ by default always suspends all threads when it hits a
>> breakpoint but you can manually switch it to suspend a thread only as I
>> just found out. That should help. I'll try.
>>
>> On Thu, Aug 16, 2018 at 4:05 PM, Josh Elser <el...@apache.org> wrote:
>>
>> I'd guess this depends on where you're setting the breakpoints -- I
>>> haven't run into the same problem you're describing.
>>>
>>> Most of the time I have to do this, it's either in an RPC handler thread
>>> or in a daemon thread we spawned off for some specific purpose. These
>>> would
>>> naturally not preclude the RS from continuing to talk to ZK or the
>>> Master.
>>>
>>>
>>> On 8/15/18 11:46 PM, Lars Francke wrote:
>>>
>>> Hi everyone,
>>>>
>>>> this might sound like a stupid question but how do you go about
>>>> debugging
>>>> HBase? (With the Java debugger I mean)
>>>>
>>>> I use IntelliJ to attach to the running Master or RegionServer as
>>>> needed,
>>>> set breakpoints etc.
>>>>
>>>> But every time I do so the connection to ZK times out and Master or RS
>>>> are
>>>> declared dead. I _always_ forget to set the timeout high enough.
>>>>
>>>> I'm using IntelliJ.
>>>>
>>>> Are you doing anything differently? Is there a way to not pause all
>>>> threads
>>>> when debugging so the heartbeats to ZK keep on going?
>>>>
>>>> Thanks,
>>>> Larss
>>>>
>>>>
>>>>
>>

Re: Debugging HBase

Posted by Josh Elser <el...@apache.org>.
I'm on Eclipse, but I think I'm an "old dog" for not having switched 
over by now ;). To my knowledge, more devs are using Intellij than 
Eclipse/other.

If you stumble onto anything that would be good for other devs, I think 
that would be a nice addition to the HBase book.

On 8/19/18 2:43 PM, Lars Francke wrote:
> Thanks Josh, are you using IntelliJ or Eclipse?
> 
> This is one of those things that has annoyed me for a while but I never
> really bothered to look at it in detail, your comment made me do it.
> 
> I think IntelliJ by default always suspends all threads when it hits a
> breakpoint but you can manually switch it to suspend a thread only as I
> just found out. That should help. I'll try.
> 
> On Thu, Aug 16, 2018 at 4:05 PM, Josh Elser <el...@apache.org> wrote:
> 
>> I'd guess this depends on where you're setting the breakpoints -- I
>> haven't run into the same problem you're describing.
>>
>> Most of the time I have to do this, it's either in an RPC handler thread
>> or in a daemon thread we spawned off for some specific purpose. These would
>> naturally not preclude the RS from continuing to talk to ZK or the Master.
>>
>>
>> On 8/15/18 11:46 PM, Lars Francke wrote:
>>
>>> Hi everyone,
>>>
>>> this might sound like a stupid question but how do you go about debugging
>>> HBase? (With the Java debugger I mean)
>>>
>>> I use IntelliJ to attach to the running Master or RegionServer as needed,
>>> set breakpoints etc.
>>>
>>> But every time I do so the connection to ZK times out and Master or RS are
>>> declared dead. I _always_ forget to set the timeout high enough.
>>>
>>> I'm using IntelliJ.
>>>
>>> Are you doing anything differently? Is there a way to not pause all
>>> threads
>>> when debugging so the heartbeats to ZK keep on going?
>>>
>>> Thanks,
>>> Larss
>>>
>>>
> 

Re: Debugging HBase

Posted by Lars Francke <la...@gmail.com>.
Thanks Josh, are you using IntelliJ or Eclipse?

This is one of those things that has annoyed me for a while but I never
really bothered to look at it in detail, your comment made me do it.

I think IntelliJ by default always suspends all threads when it hits a
breakpoint but you can manually switch it to suspend a thread only as I
just found out. That should help. I'll try.

On Thu, Aug 16, 2018 at 4:05 PM, Josh Elser <el...@apache.org> wrote:

> I'd guess this depends on where you're setting the breakpoints -- I
> haven't run into the same problem you're describing.
>
> Most of the time I have to do this, it's either in an RPC handler thread
> or in a daemon thread we spawned off for some specific purpose. These would
> naturally not preclude the RS from continuing to talk to ZK or the Master.
>
>
> On 8/15/18 11:46 PM, Lars Francke wrote:
>
>> Hi everyone,
>>
>> this might sound like a stupid question but how do you go about debugging
>> HBase? (With the Java debugger I mean)
>>
>> I use IntelliJ to attach to the running Master or RegionServer as needed,
>> set breakpoints etc.
>>
>> But every time I do so the connection to ZK times out and Master or RS are
>> declared dead. I _always_ forget to set the timeout high enough.
>>
>> I'm using IntelliJ.
>>
>> Are you doing anything differently? Is there a way to not pause all
>> threads
>> when debugging so the heartbeats to ZK keep on going?
>>
>> Thanks,
>> Larss
>>
>>

Re: Debugging HBase

Posted by Josh Elser <el...@apache.org>.
I'd guess this depends on where you're setting the breakpoints -- I 
haven't run into the same problem you're describing.

Most of the time I have to do this, it's either in an RPC handler thread 
or in a daemon thread we spawned off for some specific purpose. These 
would naturally not preclude the RS from continuing to talk to ZK or the 
Master.

On 8/15/18 11:46 PM, Lars Francke wrote:
> Hi everyone,
> 
> this might sound like a stupid question but how do you go about debugging
> HBase? (With the Java debugger I mean)
> 
> I use IntelliJ to attach to the running Master or RegionServer as needed,
> set breakpoints etc.
> 
> But every time I do so the connection to ZK times out and Master or RS are
> declared dead. I _always_ forget to set the timeout high enough.
> 
> I'm using IntelliJ.
> 
> Are you doing anything differently? Is there a way to not pause all threads
> when debugging so the heartbeats to ZK keep on going?
> 
> Thanks,
> Larss
>