Re: Bug in SMB reconnect handling

2025-06-17 Thread j_b_s34
Hi Tom, I think my fix is not very clean. It only works well because I disconnect after every poll. Maybe keeping the Session alive via SMB2Echo requests and reconnect on error is the better solution? I got the idea from this issue: https://github.com/hierynomus/smbj/issues/852#issuecomment-25

Re: Bug in SMB reconnect handling

2025-06-17 Thread Tom Cunningham
Jubar, That's great news that you have a fix for your use case! Do you plan on submitting a PR? I have some more testing to do, but I'm seeing some differing results depending on how long the connection is broken for - something like this seems to be helping though : -return share.list

Re: Bug in SMB reconnect handling

2025-06-17 Thread j_b_s34
Hi, I'm running 10 minute intervals between the polls and have disconnect=true configured so the disconnect() method is called in my case. I tested my route today with the following changes and it works pretty well. diff --git a/components/camel-smb/src/main/java/org/apache/camel/component/smb/

Re: Bug in SMB reconnect handling

2025-06-16 Thread Tom Cunningham
I gave this a try a couple of times and I don't see disconnect() called at all in this situation - I do not think that is the issue here. I think the Share needs to be refreshed at some point after the timeout, I'll try to look for a way to do that. On Mon, Jun 16, 2025 at 7:47 AM j_b_s34

Re: Bug in SMB reconnect handling

2025-06-16 Thread Claus Ibsen
Hi Yeah you are welcome to try those suggestions and see if that helps. It may also be that instead of catching IOException then catching all exceptions and then closing and potentially re-creating the client can help. But if you have a life system to test against and time then that is appreciated

Re: Bug in SMB reconnect handling

2025-06-16 Thread j_b_s34
Would catching the exception from session.close() and then force closing the connection fix the issue? Example: ... if (session != null) { try { session.close(); } catch (Exception e) { if (e.getCause() instanceof TransportException)

Re: Bug in SMB reconnect handling

2025-06-16 Thread ski n
I think this is a bug in the underlying library smbj: https://github.com/hierynomus/smbj/issues/864 And this error was also discussed on the Camel forum: https://camel.zulipchat.com/#narrow/channel/257298-camel/topic/SMB.20Componnent.20how.20the.20connection.20alive.3F/with/507977443 As I can s

Bug in SMB reconnect handling

2025-06-16 Thread j_b_s34
Hi everyone, I'm using a simple route to consume files from an SMB share and store them in a database. When the remote server becomes unreachable, the consumer keeps trying to reconnect but seems to reuse a broken connection that wasn’t properly closed. The only fix is restarting the whole route