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

xl2tpd-control: fix xl2tpd hanged up in "fopen" #125

Closed
wants to merge 1 commit into from

Conversation

wendy2001011
Copy link
Contributor

This is a fix for xl2tpd hanged up in "fopen" result fifo while working on xl2tpd with OpenWrt.

Root cause is as followings,

xl2tpd-control open result fifo ##fifo readers=1
xl2tpd-control read result fifo
xl2tpd-control close result fifo ##fifo readers=0
xl2tpd fopen result fifo ##xl2tpd is hanged up here to wait readers
xl2tpd-control unlink result fifo
The fix replaces the order of "unlink" and "close" when cleaning up to avoid hang up issue in fopen, and add the retry waiting when reading result fifo to wait xl2tpd fopen result fifo.

A refactoring proposal
There is sequence problem using fifo mechanism between xl2tpd and xl2tpd-control.
To solve the problem entirely, It is better to use socket communication between xl2tpd and xl2tpd-control.
This topic had talked with yousong.
But using socket to refactor this is a big change, I hope to get your suggestions.

What do you think about the refactoring proposal?
Thanks.

This is a fix for xl2tpd hanged up in "fopen" result fifo while working on xl2tpd with OpenWrt.

Root cause is as followings,
1. xl2tpd-control open result fifo    ##fifo readers=1
2. xl2tpd-control read result fifo
3. xl2tpd-control close result fifo     ##fifo readers=0
4. xl2tpd fopen result fifo                 ##xl2tpd is hanged up here to wait readers
5.  xl2tpd-control unlink result fifo   

The fix replaces the order of "unlink" and "close" when cleaning up to avoid hang up issue in fopen, and add the retry waiting when reading result fifo.
@shussain
Copy link
Collaborator

Change is in devel branch.

As for the refactoring idea, it seems like a good idea.

@shussain shussain closed this Feb 13, 2017
yousong added a commit to yousong/packages that referenced this pull request Feb 13, 2017
The patch was taken from xelerance/xl2tpd#125

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
yousong added a commit to openwrt/packages that referenced this pull request Feb 14, 2017
The patch was taken from xelerance/xl2tpd#125

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
yousong added a commit to openwrt/packages that referenced this pull request Feb 14, 2017
The patch was taken from xelerance/xl2tpd#125

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
ffainelli pushed a commit to ffainelli/packages that referenced this pull request Apr 1, 2017
The patch was taken from xelerance/xl2tpd#125

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
jp-bennett pushed a commit to jp-bennett/packages that referenced this pull request Jul 29, 2017
The patch was taken from xelerance/xl2tpd#125

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
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