You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2021/07/19 09:40:50 UTC
[GitHub] [incubator-eventmesh] lrhkobe commented on issue #446: Methods that continuously call WeakReference wrapper may throw an NPE
lrhkobe commented on issue #446:
URL: https://github.com/apache/incubator-eventmesh/issues/446#issuecomment-882404842
The weak reference of `ClientGroupWrapper` in `Session.java` is designed to avoid circular reference.
Because ClientGroupWrapper contains the reference of Session, and Session contains the reference of ClientGroupWrapper.
You are right. When system GC occurs, weak references will be recycled, but if the strong reference of ClientGroupWrapper also exists, maybe it will not be a problem.
We can find strong reference in the `clientGroupMap` field of `ClientSessionGroupMapping.java` :
```
private ConcurrentHashMap<String, ClientGroupWrapper> clientGroupMap;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org