Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin loading doesn't respect the expected order #9909

Closed
3 tasks done
MichaelMure opened this issue May 31, 2023 · 0 comments · Fixed by #9910
Closed
3 tasks done

Plugin loading doesn't respect the expected order #9909

MichaelMure opened this issue May 31, 2023 · 0 comments · Fixed by #9910
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization

Comments

@MichaelMure
Copy link
Contributor

Checklist

Installation method

built from source

Version

master branch

Config

No response

Description

I'm not entirely sure if it's a bug or a massive foot-gun, but it goes like this:

  • kubo use the preload_list file that list which plugin to load, and generate the corresponding loading code at compile time (ALL GOOD)
  • this code take each plugin package, and for those, each actual plugin from the declared slice (ALL GOOD)
  • kubo pass each of those to PluginLoader.Load() which collect them into a map (HUUU)
  • kubo call PluginLoader.Inject() to trigger the actual injection by iterating on that map (PROBLEM)

Golang's map iteration is famously non-deterministic ... which means kubo load those plugins in random order, and doesn't respect an eventual ordering constraint.

@MichaelMure MichaelMure added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels May 31, 2023
MichaelMure added a commit to MichaelMure/go-ipfs that referenced this issue May 31, 2023
Jorropo pushed a commit that referenced this issue May 31, 2023
@BigLep BigLep moved this to 🥞 Todo in IPFS Shipyard Team Aug 2, 2023
@BigLep BigLep moved this from 🥞 Todo to 🎉 Done in IPFS Shipyard Team Aug 3, 2023
@BigLep BigLep mentioned this issue Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant