-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Shape "Tech-debt payment #1" project #1550
Comments
Two big things stand out to me that we should work on as part of this issue: Clean up unused codeRight now because we make literally everything public, meaning that all sink structs/types are exposed publicly via a public module nested in a public module. We never get warnings about dead/unused code because the compiler can't check future uses. I suggest that we make almost everything private except certain required types to allow the compiler to infer what parts are used/not used. Add more doc commentsAs the code base gets larger and we have more contributors it will become increasingly hard to keep track of specific implementation details. I want us to get into the habit of adding more doc comments explaining high level things related to the source. This could mean for batching to explain concepts around batching. This should enable any engineer to read the comment and ramp up on the actual code without having to jump from place to place. |
I'd be happy if we try to address #1514. Editor responsiveness with |
The new rust-analyzers in the past week have been very good for me 👍 If you haven't tried it out I do recommend it! |
ProposalI've gone through all the tech debt issues we've amassed and attempted to triage them. There are a few larger groupings that we should be able to knock out with well-planned changes, and a lot of one-off smaller things that can be tackled independently. Below, I've broken down the larger items I think we should tackle. Simplifying ShutdownI believe this may be a partial blocker to the tokio/futures piece below, but it's worth discussing on its own. Our current shutdown strategy is very difficult to understand. It's dealt with both at the topology level and within each source, and the implementations have no direct link, making them both more confusing than they should be. While there are proposals floating around about various forms of structured concurrency that would be very useful for this kind of problem, none are far enough along that we should take the risk of adopting them. Instead, we should find the smallest, simplest change we can make that gets the code to a reasonable level of understandability. This will require some exploration and a proposal process, but I'm reasonably optimistic that something as simple as passing a shutdown signal into each source at startup would make things much easier to follow. Plan of attack
Related issues: #1091, #1195, #1702 Tokio 0.2 / Futures 0.3This is the big one. We need to keep up with the ecosystem here to avoid becoming blocked on upgrading important dependencies. Our goal should be to set ourselves up for easy, incremental change. Currently, we have some futures 0.3 code that we map back to futures 0.1 via the compat layer. Success here means flipping that around. We'll still have plenty of futures 0.1 code, but it should be compat-mapped into futures 0.3, which is then the default for all new code. Actually moving totally to futures 0.3 will be a long, incremental journey. This piece of work should lay the foundation and plot a rough course. Plan of attack
Other related issues: #1639, #716, #990 Simplifying SinksWe've built up a lot of layers for contributors to use when building sinks. This has gotten to the point where the number of moving parts is much higher than it should be, making it difficult to work on and understand sink code. The goal here should be to collapse and simplify the conceptual pieces involved in sink building, particularly around batching. There should be a few simple, reusable pieces for contributors to reach for, with clear names and obvious APIs. Plan of attack
Related issues: #1666, #1713, #1659, #1408, #1676 Code OrganizationAs @LucioFranco noted above, our pervasive use of We currently implement an enormous amount of logic directly in Plan of attack
Related issues: #1383 There's an unending list of other tech debt items I'd like to tackle, but these four are (in my opinion) the most strategically important and well defined. They focus on keeping our component code easy to understand, modern, and clean. I chose not to include things like improving compile times because I don't believe we have a good enough idea of what exactly needs to be done there and it's unclear how big an impact we could actually have. There are others like adding doc comments that I think are important but make less sense as part of a one-off, concerted effort. These are the types of things we should start to do as part of our normal work, striving to always leave code more understandable than when we found it. Let me know what you think! |
Nice write up! Those look like good projects. Based on what you said:
It sounds like "Tokio 0.2 / Futures 0.3" is the only project blocked, and we could start on the other 3 in parallel (if we wanted). |
As part of the "Simplifying Sinks" work we should look at #1376. Nothing, we don't have to solve this as part of the project, it's just an interesting PR to look at. |
#299 is also relevant to the "Simplifying Sinks" work. |
I'd like to add another note here, this issue #1402 seems like a good candidate that we should clean up. I'd like to also propose that we move some of our http stuff outside of |
I would like to discuss and obtain consensus on what 2 weeks of tech debt work would look like.
The text was updated successfully, but these errors were encountered: