Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto reconnect #260

Open
clicx opened this issue Jan 5, 2018 · 6 comments
Open

auto reconnect #260

clicx opened this issue Jan 5, 2018 · 6 comments

Comments

@clicx
Copy link

clicx commented Jan 5, 2018

How to set auto reconnect to server if connection broken?
It seems not recovery iscsi connection after host is down for a period time.

@sahlberg
Copy link
Owner

sahlberg commented Jan 5, 2018 via email

@clicx
Copy link
Author

clicx commented Jan 6, 2018

iscsi_tcp_service (iscsi=0x643c80, revents=4) at lib/socket.c:868
868 if (iscsi->fd < 0) {
(gdb) p iscsi->fd
$1 = -1

Even add this function calling still not work.
I modified from iscsi_dd.c and removed another link, only keep one iscsi connection. And added timeout in polling.
wk = poll(&fd, 1, 1000);

after iscsi server stopped, in the polling, we get revent=4, and wk always =1, even start iscsi server again, the same things returned.
So I looked into the calling stack, fd=-1, therefor it won't retry.

@sitsofe
Copy link
Contributor

sitsofe commented Jan 6, 2018

@clicx can you tell us which platform you're using libiscsi on?

@sitsofe
Copy link
Contributor

sitsofe commented Jan 6, 2018

@clicx
Copy link
Author

clicx commented Jan 9, 2018

@sitsofe Linux, I think in qemu built-in libiscsi has same behaviour, while I using an iSCSI target to start a vm, after connection lost for a period of time, the vm will lost disk permanently. But kernel mode iscsi initiator in linux does not, it always keep connection session. So I think if it need any extra configuration on it.

@clicx
Copy link
Author

clicx commented Jan 19, 2018

I tested, it seems working in most time, but some time, it happened something:
the event_loop running very fast (means do nothing, just loop), always got: fd=13, wk=1, revent=5
From traffic, it seems continuing logon(successfully) ->logout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants