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

PollerBase.ExecuteTimers() NullReferenceException #1010

Open
valeriob opened this issue Mar 24, 2022 · 1 comment
Open

PollerBase.ExecuteTimers() NullReferenceException #1010

valeriob opened this issue Mar 24, 2022 · 1 comment

Comments

@valeriob
Copy link
Contributor

valeriob commented Mar 24, 2022

Environment

NetMQ Version:    4.0.1.8
Operating System: Windows
.NET Version:     dotnet 6

Expected behaviour

Not killing the process :D

Actual behaviour

When this occurs, the process crashes badly

Steps to reproduce the behaviour

We frequently start and stop endpoints with a backend and frontend, with a poller for async api execution, it happens more frequently if this code is used

            _poller.Remove(_frontend);
            _poller.Remove(_backend);
            _poller.Stop();

instead of

            _poller.Stop();
            _poller.Remove(_frontend);
            _poller.Remove(_backend);

It only happens if I enable timeouts on the frontend socket

_frontend.Options.HeartbeatInterval = TimeSpan.FromSeconds(5);
_frontend.Options.HeartbeatTimeout = TimeSpan.FromSeconds(1);

Is it possible that the code than handle timers is not really robust to this kind of connect/disconnect events ?
For example what i think is happening is that the timer collection is modified when this method runs :

image

image

image

Thank you
Valerio

@valeriob
Copy link
Contributor Author

I gave it a try for a few days, but the best I could do is mitigate the problem via #1011 .
It's not clear to me the whole mechanism, it looks like that more than one timer is created (for the same Sink and Id), and that the cancel timer is not very robust (it only cancel the first it finds).

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

1 participant