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

Refactor initialization and self termination code #51

Merged
merged 5 commits into from
May 26, 2022

Conversation

simo5
Copy link
Contributor

@simo5 simo5 commented May 25, 2022

Self termination was not happening if the timeout was larger than about 1 minute, due to the event loop self management which makes it return to the calling function regularly.
In order to ignore unimportnat events that wake up the event loop it means we cannot measure idleness from the event loop general activity but we need to do so via measuring actual significant events.

Actual activity happens when clients make requests, so use the socket reader events as signal to reset the idler event.

While there also gather some statistics that can be printed ad debug level 1 (INFO).

simo5 added 4 commits May 25, 2022 15:57
The event loop cycles too often to use verto_run_once() as a way
to deal with marking activity. So revert to using verto_run() and
set the termination handler once for now.

Signed-off-by: Simo Sorce <simo@redhat.com>
Refactor init functions and move them in the appropriate file.

Signed-off-by: Simo Sorce <simo@redhat.com>
These are functions that are used to manage the proxy own main process
after initialization. Store in their own file so the scope is clear.

Signed-off-by: Simo Sorce <simo@redhat.com>
Self termination need to happen only when gssproxy is idle for a certina
amount of time.

However due to non material activity the gssproxy performs through the
verto event handler we need to actively measure ideling rather than
depend on things like verto_idle.

Ad an accounting function to our socket handler.
This now allows us to collect some interesting statistics as well as
reset the idle handler when there is actual activity ongoing.

We reset the handler only upon receiving data from a client, as that
indicates a requested activity. Writes happen only as reposnses and are
considered part of a single activity event together with the read that
caused the idel handler reset.

Signed-off-by: Simo Sorce <simo@redhat.com>
Currently just checks that initialization and self termination
actually happened.

Signed-off-by: Simo Sorce <simo@redhat.com>
@simo5
Copy link
Contributor Author

simo5 commented May 26, 2022

Manual testing works + added basic testing for self termination in userproxytest.c

@simo5 simo5 merged commit a3d215e into gssapi:main May 26, 2022
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.

1 participant