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
Fix issue removing click kernel module. #407
base: master
Are you sure you want to change the base?
Conversation
The click router threads refuse to die because no one is setting the _stop_flag. There is an infinite loop in RouterThread::driver() function. Call request_stop killing router in master.cc to fix the problem.
Shouldn't it be already dying at that point? What sequence of actions lead your router to stay alive? |
The loop inside RouterThread::driver() function breaks if _stop_flag is set to true:
If I'm not wrong, there is just a function setting this flag which is request_stop() in master.hh:
Without calling request_stop from Master::kill_router(Router *router) , when I remove the click kernel module (using rmmod) I receive this kind of error:
So if _stop_flag is false, RouterThread::driver() is an infinite loop and I suppose this is why kill_router_threads() from linuxmodule/sched.cc fails after 5 seconds and several attempts:
I think this issue is related just to kernel space and it works fine user space. |
I'm less familiar with kernel click. However request_stop should be called from adjust_runcount/set_runcount. |
Yes, but set_runcount with STOP_RUNCOUNT is called just if click_router is defined and it can be undefined (actually this is my case) so there is no function calling set_runcount:
|
I acknowledge the problem, I had it myself. However setting always stop_flag to true seems dangerous. If run_count is still not 0 because some references are still kept, the router should not finish to die. Maybe you can detail your sequence of event? How did click_router got undefined without run_count being 0? That's the real issue, I think. |
I will investigate more about click_router getting undefined. |
Anyway I discovered that the change I made was part of the trunk code before and it was removed at some point: |
The click router threads refuse to die because no one is setting the _stop_flag.
There is an infinite loop in RouterThread::driver() function.
Call request_stop killing router in master.cc to fix the problem.