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

[BUG] 2.4.6 evi_flat_rotate only rotates last event, when multiple events write to same file #1933

Closed
adamoverbeeke opened this issue Jan 9, 2020 · 1 comment
Assignees
Labels
Milestone

Comments

@adamoverbeeke
Copy link

adamoverbeeke commented Jan 9, 2020

OpenSIPS version you are running

version: opensips 2.4.6 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.
git revision: 65e83b017
main.c compiled on  with gcc 4.9.2

Describe the bug

We are subscribing multiple events to the same flatstore file. When you perform a evi_flat_rotate on the shared file only one event is "rotated" the other events continue to write to the old file.

To Reproduce

Steps to reproduce the behavior:

  1. subscribe two or more events to the same flatstore file in route startup
  2. create a timer route to print events and confirm events are written to file
  3. mv shared file
  4. perform opensipsctl fifo evi_flat_rotate /path/to/shared/event
  5. notice only "last" subscribe event "rotated" to the new file.

Expected behavior
We expect all subscribed events to rotate.

Relevant System Logs
Printed right after the rotate command

root@7a71fbe67c71:/etc/opensips# cat shared-events
E_RECORD_ZZTEST2;testValue
E_RECORD_ZZTEST2;testValue
E_RECORD_ZZTEST2;testValue
E_RECORD_ZZTEST2;testValue
E_RECORD_ZZTEST2;testValue

root@7a71fbe67c71:/etc/opensips# cat shared-events-000
E_RECORD_AATEST1;testValue
E_RECORD_ZZTEST2;testValue
E_RECORD_AATEST1;testValue
E_RECORD_ZZTEST2;testValue
E_RECORD_AATEST1;testValue
E_RECORD_ZZTEST2;testValue
E_RECORD_AATEST1;testValue
E_RECORD_ZZTEST2;testValue
E_RECORD_AATEST1;testValue
E_RECORD_AATEST1;testValue
E_RECORD_AATEST1;testValue
E_RECORD_AATEST1;testValue
E_RECORD_AATEST1;testValue

OS/environment information

  • ran on opensips docker container:

Additional context
Attaching min config script.

opensips.cfg.txt

@rvlad-patrascu rvlad-patrascu self-assigned this Jan 9, 2020
@bogdan-iancu bogdan-iancu added this to the 2.4.7 milestone Jan 10, 2020
@adamoverbeeke
Copy link
Author

@bogdan-iancu I am running with this patch in the meantime.
0006-evi_flat_rotate_fix.patch.txt

rvlad-patrascu added a commit that referenced this issue Jan 20, 2020
…ame file

Use the same internal shm struct corresponding to a file for each evi
subscription for that file. This fixes an issue with the 'evi_flat_rotate' MI
command not properly "rotating" multiple subscriptions to the new file. Besides,
a file is now opened only once regardless of how many subscribtions there are
for the same file.
Also, do not reuse an old 'evi_reply_sock' structure for a new subscription for
the same file (if the file corresponding to an old subscription was not yet
closed by all processes). This led to incorrect expire times for new
subscriptions.

Fixes #1933

(cherry picked from commit a2f4f80)
rvlad-patrascu added a commit that referenced this issue Jan 20, 2020
…ame file

Use the same internal shm struct corresponding to a file for each evi
subscription for that file. This fixes an issue with the 'evi_flat_rotate' MI
command not properly "rotating" multiple subscriptions to the new file. Besides,
a file is now opened only once regardless of how many subscribtions there are
for the same file.
Also, do not reuse an old 'evi_reply_sock' structure for a new subscription for
the same file (if the file corresponding to an old subscription was not yet
closed by all processes). This led to incorrect expire times for new
subscriptions.

Fixes #1933

(cherry picked from commit a2f4f80)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants