-
Notifications
You must be signed in to change notification settings - Fork 25
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
Exec scripts respawning too fast #138
Comments
Hi, uh, I'm flabbergasted that the connection count might cause issues, but I'll surely dive into that once more, just quite likely not today. The "respawning too fast" typically means that your *.py script did terminate -- it's expected to be a long-running process that handles input from stdin in a loop until stdin breaks. Do your Python scrips work that way? You can check easily using "ps", the Python process IDs should not change at all. Cheers, Marc |
Dear Marc, Many thanks for your quick response. I had the same thought for the respawning events but wasn't sure about how the worker handles the scripts. Actually, I got these errors in My logging python scripts use a for loop rather than a while. From my tests, I understand logging exec scripts are not invoked until there's a message in the stdin pipe and then they remain running until the worker ends. async def main():
authen_info = ""
for line in sys.stdin:
try:
authen_info = line
authen_fields = ["date", "tacacs_server", "username", "nas_ip", "nac_ip", "realm", "result", "message_id", "action", "authen_action", "authen_type", "authen_service"]
authen_dic = dict(zip(authen_fields,authen_info.replace("\n","").split(";")))
await db.insert_authen(authen_dic)
except Exception as e:
continue
if __name__ == "__main__":
asyncio.run(main()) Tests proven to work successfully proven by the previous behaviour description and I'm not getting any respawning messages until some unknown conditions happen. I didn't implement a while loop at first in case the script got stuck and I've got the MAVIS LDAP module the same way, though this doesn't appear to fail. Anyway, I'll have a go with the approach you advised as indeed a potential error in the stdin may be breaking this. Thanks and regards, |
Dear Marc,
I'm having a weird issue with the service. I've got tac_plus-ng running in a docker and I'm getting these messages from time to time. It looks to be happening on scripts run on EXEC instructions.
Right now the
tacspooflog.pl
is the one issued.However, I had this error showing up for the other logging scripts for the AAA logs as well. These are python scripts that write to a remote database.
This is the current configuration.
I suspect it may be related to #112 in the way the worker gets blocked and it's not able to release the pending connections. The docker runs on a server that has way available resources, so it doesn't look to be a problem with that. Actually, these errors are happening with low connection load.
As you can see, this aggregated 92 connections doesn't match the showed connections. These could be because the remaining are kept in CLOSE_WAIT or FIN_WAIT state; I can check out the TCP timers, but I would like to know if you have got a clue for the reason for those respawning events or how to troubleshoot them.
Thanks and regards,
The text was updated successfully, but these errors were encountered: