VisionSystemsInc / VisionSystemsInc/terra

Add support for port 0 for logging

Open
#192 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2
Forks
3
Avg merge
22m
Merged PRs (30d)
1

Description

Starting multiple terra runs in quick succession can hit a race condition in the log port if each process is manually checking if a port is available.

A good solution is to just let the OS pick a port for you (via port 0). But we need to add special support for this.


I've investigated the future compatibility of this feature some.

  • Eventually, I want to use an AF_UNIX file socket, however in windows, this feature was never added to python (due to MS having half assed support for things like UDP)
  • The plan was to eliminate using INET for most use case, however there will still be many cases that will still need AF_INET
    • Windows. When using virtualenv, localhost will be acceptable, but on docker compute, we will be back to needing the actual IP, and depending on the configuration of the computer, we will need the same TERRA_RESOLVE_HOSTNAME workaround
    • Distributed computing (celery) will need AF_INET for sure.
  • WSL and Linux will should be able to use AF_UNIX

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by locating the logging server setup and its port selection, then trace how the selected port is communicated to Terra runs; done means port 0 lets the OS select a usable logging port without the described race condition.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.