mailgun / mailgun/groupcache

Move global state to explicit var to allow deallocation?

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

Nobody has claimed this yet.

Dominant language
Go
Stars
539
Forks
76
PR merge metrics
No merged PRs in 30d

Description

Hi,

I have a use case for, while not restarting the application, bringing down groupcache allocated resources (let the GC release them), then recreate those resources with new configurations.

I see the global state is the obvious roadblock for that scenario.

So I started to sketch a change to allow recreation of groupcache resources. I am keeping existing APIs unchanged and adding some alternative APIs with support for an extra argument for explicit state ("workspace") provided by the caller. Hence the caller would be able to drop references to workspace in order to allow the garbage collector to get rid of its resources.

Draft PR: https://github.com/mailgun/groupcache/pull/65

What do you think? Would this be generally useful for a wider audience?

Cheers,
Everton

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

Start by reviewing the global state and the draft PR #65 mentioned in the issue. Trace how the existing APIs hold groupcache resources and compare them with the proposed explicit workspace APIs. Done means reaching agreement on an API that permits resource recreation and allows unused resources to become collectible.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.