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

Signal BaseReader loop termination fix #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kitaisreal
Copy link

Signal BaseReader loop termination fix.
Motivation: The problem is that FiltrationImpl manager is sitting on pcap_loop that started from BaseReader and pcap_breakloop does not terminate it, according to documentation pcap_breakloop should not terminate it. As a solution I decided to put it in separate thread, make communication through conditional variable and cancel loop with pthread_cancel. Please check following links:
the-tcpdump-group/libpcap#734
https://linux.die.net/man/3/pcap_breakloop
https://www.tcpdump.org/manpages/pcap_breakloop.3pcap.html

  1. Put lcap_loop in separate thread that communicate with BaseReader.
  2. Updated filtration manager destructor to call stop double times. We call stop from controller for filtration and analyzer manager.
  3. Added some Todos.

@coveralls
Copy link

coveralls commented Aug 5, 2020

Coverage Status

Coverage increased (+0.05%) to 46.773% when pulling 99d6f70 on kitaisreal:signal-base-reader-loop-termination-fix into d1a2785 on epam:master.

FiltrationImpl thread is waiting on pcap_loop from BaseReader
and pcap_breakloop does not terminate it.
https://github.com/the-tcpdump-group/lipcap/issues/734.
Implementation steps:
1. Put lcap_loop in BaseReader in separate thread.
2. Build communication between BaseReader and that thread
using conditional_variable.
@kitaisreal kitaisreal force-pushed the signal-base-reader-loop-termination-fix branch from 99d6f70 to e4115c4 Compare August 5, 2020 14:51
@kitaisreal kitaisreal changed the title Signal BaseReader loop termination fix. Signal BaseReader loop termination fix Aug 5, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants