Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: wyborowiec/otp
head fork: wyborowiec/otp
compare: otp_connection_race
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Commits on Jul 13, 2012
Waclaw Borowiec Race condition when adding/removing connections
When removing connection from OtpNode connections
collection make sure that proper connection object is
removed. It prevents race condition when other
node sets new connection before the old one is
removed. It happens under heavy system load.
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/jinterface/java_src/com/ericsson/otp/erlang/
8 lib/jinterface/java_src/com/ericsson/otp/erlang/
@@ -517,7 +517,13 @@ void addConnection(final OtpCookedConnection conn) {
private void removeConnection(final OtpCookedConnection conn) {
if (conn != null && != null) {
- connections.remove(;
+ synchronized (connections) {
+ OtpCookedConnection connectionInCollection = connections
+ .get(;
+ if (connectionInCollection == conn) {
+ connections.remove(;
+ }
+ }

No commit comments for this range

Something went wrong with that request. Please try again.