hierynomus / smbj

Server Message Block (SMB2, SMB3) implementation in Java
Other
713 stars 180 forks source link

Thread getting stuck for more than 10 minutes during login #578

Closed SubhasishDey closed 3 years ago

SubhasishDey commented 4 years ago

Hi,

We are finding that the SMBJ client stucks during connect for a period of 10 mins or more even if the socket timeouts are set in the SMBConfig.

We see the below thread dump, any hint from anyone will be deeply appreciated.

Id=488 in TIMED_WAITING at sun.misc.Unsafe.park(Native Method)

ecki commented 4 years ago

Can you show the other threads as well?

Without looking too deep into it, my experience in this area are broken DFS scenarios with dangling Server references. Did you try to target a server directly and turn DFS of?

SubhasishDey commented 4 years ago

Hi ecki,

 Thanks for your reply, I have not set the dfs explicitly so I think it is false by default.
  But I will explicitly set it false and retry and look for any occurrence as this issue doesnot happen always.

Thanks and Regards, Subhasish

hierynomus commented 3 years ago

@SubhasishDey Any update on this?

SubhasishDey commented 3 years ago

Hi @hierynomus / @ecki ,

I toggled the dfs setting for different server and dfs shares and then figured that the actual issue occurs when we try to connect to a non DFS server with DFS enabled in the smbj client. We have set the timeout, but we still see this thread stack. This hangs forever.

`"HTTP Handler 127.0.0.1" Id=21030 in WAITING at java.base@11.0.10/jdk.internal.misc.Unsafe.park(Native Method)

Thanks and Regards, Subhasish

hierynomus commented 3 years ago

@SubhasishDey Current master contains a fix for the hanging of the getReferral call. I'm not sure why your server does not respond.

SubhasishDey commented 3 years ago

Thanks @hierynomus …I will take the update. Our suspect on why the server doesnot respond was because its not a DFS server in a network restricted area.

Anyways.. thanks again...I will test wit your inputs.

hierynomus commented 3 years ago

I'm adding one additional fix, should be ready end of day today.

hierynomus commented 3 years ago

Additional fix is also merged. Good luck testing.

shanthankumar24 commented 3 years ago

Hi @hierynomus

The fix is working fine for us , will it be part of the official release of 0.11.2? If so when can we expect it to be released?

hierynomus commented 3 years ago

Yes, it will be part of the next release.