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

Logout does not happen #30

Open
richlv opened this issue Jun 7, 2021 · 3 comments
Open

Logout does not happen #30

richlv opened this issue Jun 7, 2021 · 3 comments

Comments

@richlv
Copy link
Collaborator

richlv commented Jun 7, 2021

Looks like the fix for #26 might not have addressed the root cause.
Seeing an issue where DEMOLISH is being called, but $ua is not present there, thus logout does not happen.

Commenting out "return unless ($ua);" doesn't fix the logout issue (obviously), but it also does not produce any errors.

@richlv
Copy link
Collaborator Author

richlv commented Jun 7, 2021

Some help from IRC:

16:35 Richlv: it likely got destroyed before your object did. once you reach the global destroy phase, all bets are off on ordering of destruction of stuff
16:37 Richlv: I think you can do some stuff with an END{} block and keeping track of things that might need to be cleaned up. but i'm not sure if that'll run into the same issue offhand
16:38 otherwise you need to make sure to destroy the objects yourself or call a logout function before going to exit()
16:39 you might be able to get away with just making your own new UA object during demolish, since it doesn't look like the rest of the data you have are actually objects
16:40 there's also no point in saving the post_response during demolish since the object won't exist after that sub exits anyway

Quoting from Perldoc:

The order in which objects are destroyed during the global destruction before the program exits is unpredictable. This means that any objects contained by your object may already have been destroyed.

@whosgonna
Copy link
Owner

Is there a way to reproduce the scenario? To some degree, I'm not sure what can be possible. For example, if the network is lost, and no log out occurs, there's not much that the client can do to address this, etc

@richlv
Copy link
Collaborator Author

richlv commented Jun 14, 2021

My understanding is that it will happen sometimes - the issue is the non-deterministic destroying of objects in the global destroy phase.
So $ua can be destroyed by the time we try to use it. Which is why checking for it solved some of the warnings.
My understanding is that this is a Perl specific thing, not related to network problems or other external factors.

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