mirror of https://github.com/schoebel/mars
client: add network abort
TCP_KEEPALIVE doesn't seem to work. Use explicit timeout instead when the network just drops any packet.
This commit is contained in:
parent
8309fb97e6
commit
59d141c06e
|
@ -18,6 +18,9 @@
|
|||
|
||||
#define CLIENT_HASH_MAX (PAGE_SIZE / sizeof(struct list_head))
|
||||
|
||||
int mars_client_abort = 10;
|
||||
EXPORT_SYMBOL_GPL(mars_client_abort);
|
||||
|
||||
///////////////////////// own helper functions ////////////////////////
|
||||
|
||||
static int thread_count = 0;
|
||||
|
@ -101,6 +104,8 @@ static int _connect(struct client_output *output, const char *str)
|
|||
goto really_done;
|
||||
}
|
||||
output->socket.s_shutdown_on_err = true;
|
||||
output->socket.s_send_abort = mars_client_abort;
|
||||
output->socket.s_recv_abort = mars_client_abort;
|
||||
|
||||
output->receiver.thread = brick_thread_create(receiver_thread, output, "mars_receiver%d", thread_count++);
|
||||
if (unlikely(!output->receiver.thread)) {
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
extern struct mars_limiter client_limiter;
|
||||
extern int global_net_io_timeout;
|
||||
extern int mars_client_abort;
|
||||
|
||||
struct client_mref_aspect {
|
||||
GENERIC_ASPECT(mref);
|
||||
|
|
|
@ -296,6 +296,7 @@ ctl_table mars_table[] = {
|
|||
INT_ENTRY("propagate_interval_sec", mars_propagate_interval, 0600),
|
||||
INT_ENTRY("sync_flip_interval_sec", mars_sync_flip_interval, 0600),
|
||||
INT_ENTRY("peer_abort", mars_peer_abort, 0600),
|
||||
INT_ENTRY("client_abort", mars_client_abort, 0600),
|
||||
INT_ENTRY("do_fast_fullsync", mars_fast_fullsync, 0600),
|
||||
INT_ENTRY("logrot_auto_gb", global_logrot_auto, 0600),
|
||||
INT_ENTRY("required_total_space_0_gb", global_free_space_0, 0600),
|
||||
|
|
Loading…
Reference in New Issue