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

stability #1

Open
mr-smit opened this issue Feb 2, 2019 · 9 comments
Open

stability #1

mr-smit opened this issue Feb 2, 2019 · 9 comments

Comments

@mr-smit
Copy link

mr-smit commented Feb 2, 2019

Hi, searched all internet to find this functionallity. Can you tell more about it? Is it on your production clusters? its stable?

i want to use it in three geo clusters

and how to install and configure it ?

@Andrei-Pozolotin
Copy link
Collaborator

  1. stability: yes, used in production

  2. install function: download and unpack:

dovecot_syncer() {
    echo "# $FUNCNAME"
    local plugin_source="https://raw.githubusercontent.com/random-archer/dovecot_plugin_syncer/master/binary.tar.gz"
    local plugin_target="/tmp/binary.tar.gz"
    curl "$plugin_source" --output "$plugin_target"
    tar xzvf "$plugin_target" -C "/"  
}
  1. usage: study unit test
    https://github.com/random-archer/dovecot_plugin_syncer/blob/master/test/dovecot.sh

@mr-smit
Copy link
Author

mr-smit commented Aug 30, 2019

thanks, will try to install and configure it today, i will report later.

@mr-smit
Copy link
Author

mr-smit commented Nov 11, 2019

works stable on 3 geo clusters , as u sad first i need to create my own .sh script to read file pipe and run

doveadm sync -f -u $user_name -n inbox remote:root@serv1c1
doveadm sync -f -u $user_name -n inbox remote:root@serv1c3
doveadm sync -f -u $user_name -n inbox remote:root@serv1c3
...etc.. unlimited

thanks for good script, dovecot must have it.

@Andrei-Pozolotin
Copy link
Collaborator

great. re: need to create my own .sh script:
here is another source for inspiration: https://github.com/random-python/mail_serv

@mr-smit
Copy link
Author

mr-smit commented Feb 21, 2020

hi, after some time i got this error:

Feb 21 14:57:41 imap([email protected])<26532><fTH/XBWf+ul/AAAB>:

Error: syncer-plugin.v13/syncer_report_change : failed to pipe: syncer_record_eol rv=-1
Error: syncer-plugin.v13/syncer_report_change : failed to pipe: record_entry rv=-1

how to reproduce, set limits on imap process and make many connections to imap, then you will see error like:
Remote closed connection (destination service { process_limit } reached?) (

then do dovecot restart:
service dovecot restart

and you will see errors about plugin and pipe.

What do you think ?

The problem is that imap process is not shutting down when no connections are made.

@mr-smit
Copy link
Author

mr-smit commented Feb 21, 2020

As I understand, we need to timeout if we can't write to pipe

int fd_pipe = open(syncer_pipe, O_RDWR); // non-blocking fifo pipe

how to add timeout here for example 3 sec ?

@mr-smit
Copy link
Author

mr-smit commented Feb 24, 2020

fd_set fds;
FD_ZERO(&fds);
FD_SET(fd_pipe, &fds);
struct timeval tv = { 1, 0 }; // 1 secs, 0 usecs

int st = select(fd_pipe+1, NULL, &fds, NULL, &tv);
if (st < 0) {
	// select threw an error
	syncer_log_err("[err] select error");
} else if (FD_ISSET(fd_pipe, &fds)) {
	// report change to non-blocking fifo pipe
	int rv;
	rv = write(fd_pipe, record_entry, strlen(record_entry));
	if (rv < 0) {
		syncer_log_err("%s : %s rv=%d", __func__, "failed to pipe: record_entry", rv);
	}
	rv = write(fd_pipe, syncer_record_eol, strlen(syncer_record_eol));
	if (rv < 0) {
		syncer_log_err("%s : %s rv=%d", __func__, "failed to pipe: syncer_record_eol", rv);
	}
} else {
	// Writing not possible in 1 seconds, wait
	syncer_log_err("[err] write not possible in 1 sec");
}

@mr-smit
Copy link
Author

mr-smit commented Feb 24, 2020

now all works fine.

@pfak
Copy link

pfak commented Jan 29, 2023

Is this patch still required?

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