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

EpidemicServer uses inconsistent locks around listeners #36

Open
dclements opened this issue Jan 14, 2013 · 3 comments
Open

EpidemicServer uses inconsistent locks around listeners #36

dclements opened this issue Jan 14, 2013 · 3 comments
Labels

Comments

@dclements
Copy link
Contributor

registerListener synchronize around the this object, while the Subscription.cancel call does not need a lock. Meanwhile insertRevision has no synchronization, nor does its caller deliver, but its caller accept synchronizes around the lock object. The same basic pattern is true around acceptRevision and merge.

@dicej
Copy link
Member

dicej commented Jan 14, 2013

The registerListener/Subscription.cancel issue is definitely a bug, but I'm not seeing where the races are in the other cases you mentioned. Can you provide an example?

@dclements
Copy link
Contributor Author

Inconsistent locking is pretty much always a bad practice (per JCIP). Listener registrations can occur while a revision is being inserted.

@dicej
Copy link
Member

dicej commented Jan 15, 2013

I see now. I hadn't noticed that both registerListener and the insertRevision operate on the same collection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants