oxidecomputer / oxidecomputer/opte

`FlowTable` could have an `Entry` API

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

Nobody has claimed this yet.

cleanup good first issue
Dominant language
Rust
Stars
77
Forks
11
Avg merge
9d 20h
Merged PRs (30d)
8

Description

BTreeMap provides an Entry API to prevent duplicate lookups for successive operations on the same key. FlowTable wraps a private BTreeMap to provide fixed capacity constraints, meaning we cannot use this API directly without some care to make sure that an Entry::Vacant cannot be used to insert into a full table.

An entry method on FlowTable which handles these semantics would be useful. There are a handful of places which would benefit from this for code cleanup, e.g. TCP flow state management.

Contributor guide

Open the contributing guide

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

Locate FlowTable and inspect how its private BTreeMap enforces fixed capacity. Compare the desired API with BTreeMap::entry, then review the TCP flow state management cleanup mentioned in the issue. Done means successive operations avoid duplicate lookups while a vacant entry cannot insert into a full table; add or update tests for those capacity semantics.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.