Skip to content

Commit

Permalink
Fix NailgunExecutor to support more than one connect attempt
Browse files Browse the repository at this point in the history
In 73e25e7, the `WAIT_INTERVAL` field of `ProcessManager` was renamed to
`WAIT_INTERVAL_SEC`, except for one location in `NailgunExecutor` which broke as
a result.  This causes the `try_connect` method to fail if one connection
attempt fails, regardless of what the user supplies as the
`--nailgun-connect-attempts` flag on the command line.

Testing Done:
I discovered this issue by using `pylint` and then manually verifying that the warning was correct:

```
$ pylint -E -d no-self-argument src/python/pants/java/nailgun_executor.py
No config file found, using default configuration
************* Module pants.java.nailgun_executor
E:229,17: Instance of 'NailgunExecutor' has no 'WAIT_INTERVAL' member
(no-member)
```

After fixing the issue the `pylint` warning disappears:

```
$ pylint -E -d no-self-argument src/python/pants/java/nailgun_executor.py
No config file found, using default configuration
```

Bugs closed: 2196

Reviewed at https://rbcommons.com/s/twitter/r/2822/
  • Loading branch information
Gabriella439 authored and stuhood committed Sep 15, 2015
1 parent b0143bc commit a86d0ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/python/pants/java/nailgun_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def ensure_connectable(self, nailgun):
sock.close()

attempt_count += 1
time.sleep(self.WAIT_INTERVAL)
time.sleep(self.WAIT_INTERVAL_SEC)

def _spawn_nailgun_server(self, fingerprint, jvm_options, classpath, stdout, stderr):
"""Synchronously spawn a new nailgun server."""
Expand Down

0 comments on commit a86d0ad

Please sign in to comment.