dklab_logreplica icon indicating copy to clipboard operation
dklab_logreplica copied to clipboard

Extra characters in logs

Open vsespb opened this issue 10 years ago • 6 comments

It seems it inserts ==> <== into logs after sync. Can't find documentation about it and how to avoid it..?

vsespb avatar Nov 17 '14 17:11 vsespb

It looks like a bug. Should not insert something like that.

Could you please help to reproduce? Do you have a minimal set of files/commands to reproduce?

On Monday, November 17, 2014, Victor Efimov [email protected] wrote:

It seems it inserts ==> <== into logs after sync. Can't find documentation about it and how to avoid it..?

— Reply to this email directly or view it on GitHub https://github.com/DmitryKoterov/dklab_logreplica/issues/1.

dimikot avatar Nov 17 '14 18:11 dimikot

It looks like a bug. Should not insert something like that.

That's strange. I was thinking it's a feature, because there is code to insert that https://github.com/DmitryKoterov/dklab_logreplica/blob/master/dklab_logreplica.pl#L485 https://github.com/DmitryKoterov/dklab_logreplica/blob/master/dklab_logreplica.pl#L499

Maybe incompatible with a log rotation or something?

Could you please help to reproduce?

We need to think how to minimize it to PoC..

vsespb avatar Nov 17 '14 18:11 vsespb

The code you mention is just a part of the protocol implementation to communicate between remote and local parts. This code multiplexes data flows from different log files into a single stream.

The protocol looks similar to the output format used by "tail -f /var/log/*" command.

On Monday, November 17, 2014, Victor Efimov [email protected] wrote:

It looks like a bug. Should not insert something like that.

That's strange. I was thinking it's a feature, because there is code to insert that https://github.com/DmitryKoterov/dklab_logreplica/blob/master/dklab_logreplica.pl#L485 https://github.com/DmitryKoterov/dklab_logreplica/blob/master/dklab_logreplica.pl#L499

Maybe incompatible with a log rotation or something?

Could you please help to reproduce?

We need to think how to minimize it to PoC..

— Reply to this email directly or view it on GitHub https://github.com/DmitryKoterov/dklab_logreplica/issues/1#issuecomment-63352112 .

dimikot avatar Nov 18 '14 21:11 dimikot

Добрый день. Такая ситуация возникает, когда в лог файл в конец строки записывается \n с некоторой задержкой. Это поведение можно повторить, если создать лог файл и писать в него руками отдельно текст, запись, \n, запись. Чтобы это исправить можно в код между строк 476 и 478 вставить: if ( !m/^[^\n]*\n/s ){ sleep(0.1); next; } А также в шапку добавить: use Time::HiRes;

vmironenko avatar Nov 23 '14 14:11 vmironenko

Thanks, I'll try to reproduce and fix soon.

dimikot avatar Nov 27 '14 23:11 dimikot

@vmironenko 's fix helped us. thanks.

vsespb avatar Dec 09 '14 16:12 vsespb