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

psgi atexit() hook useless when committing harakiri (psgix.harakiri.commit=1) #778

Closed
aldem opened this issue Nov 20, 2014 · 3 comments
Closed

Comments

@aldem
Copy link
Contributor

aldem commented Nov 20, 2014

Due to the fact that formally request is not completed yet (as this happens in after_request() hook), uwsgi_perl_atexit() is doing nothing on harakiri.commit

Consequence: no object destruction, no proper cleanup.

@unbit
Copy link
Owner

unbit commented Nov 21, 2014

This has been fixed some week ago in 2.0 and 2.1 branches: #772 (comment)

@aldem
Copy link
Contributor Author

aldem commented Nov 21, 2014

I am afraid it has not, at least it doesn't work as expected neither in master or 2.0 branch.

The code:

uwsgi::atexit(sub {
    uwsgi::log("Worker exited\n");
});

has no effect on harakiri.commit (but it does when worker is HUPed). Also, when using Guard:

use Guard;
our $guard = guard {
  uwsgi::log("Guard called\n");
}

nothing happens (while it is executed, as expected, in normal cases).

unbit added a commit that referenced this issue Nov 21, 2014
@unbit unbit closed this as completed in f42294c Nov 21, 2014
@unbit
Copy link
Owner

unbit commented Nov 21, 2014

oops missed a line. Latest code should work reliably

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

No branches or pull requests

2 participants