Skip to content

Connectors#5108

Merged
lennyburdette merged 112 commits intonextfrom
connectors
Jul 30, 2024
Merged

Connectors#5108
lennyburdette merged 112 commits intonextfrom
connectors

Conversation

@lennyburdette
Copy link
Copy Markdown
Contributor

@lennyburdette lennyburdette commented May 7, 2024


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Tests added and passing3
    • Unit Tests
    • Integration Tests
    • Manual Tests

Exceptions

Note any exceptions here

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 7, 2024

@lennyburdette, please consider creating a changeset entry in /.changesets/. These instructions describe the process and tooling.

@router-perf
Copy link
Copy Markdown

router-perf bot commented May 7, 2024

CI performance tests

  • step - Basic stress test that steps up the number of users over time
  • events_big_cap_high_rate_callback - Stress test for events with a lot of users, deduplication enabled and high rate event with a big queue capacity using callback mode
  • large-request - Stress test with a 1 MB request payload
  • events - Stress test for events with a lot of users and deduplication ENABLED
  • xxlarge-request - Stress test with 100 MB request payload
  • events_without_dedup - Stress test for events with a lot of users and deduplication DISABLED
  • xlarge-request - Stress test with 10 MB request payload
  • step-jemalloc-tuning - Clone of the basic stress test for jemalloc tuning
  • events_callback - Stress test for events with a lot of users and deduplication ENABLED in callback mode
  • no-graphos - Basic stress test, no GraphOS.
  • reload - Reload test over a long period of time at a constant rate of users
  • events_big_cap_high_rate - Stress test for events with a lot of users, deduplication enabled and high rate event with a big queue capacity
  • events_without_dedup_callback - Stress test for events with a lot of users and deduplication DISABLED using callback mode
  • const - Basic stress test that runs with a constant number of users

@lennyburdette lennyburdette marked this pull request as ready for review July 30, 2024 01:23
@lennyburdette lennyburdette requested a review from a team July 30, 2024 01:23
@lennyburdette lennyburdette changed the title DO NOT MERGE Connectors Connectors Jul 30, 2024
@abernix
Copy link
Copy Markdown
Member

abernix commented Jul 30, 2024

saw two things that can likely land in dev right away too

This is really good to call out – do we inventory this somewhere?

Copy link
Copy Markdown
Contributor

@Geal Geal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have only reviewed the parts where the connectors interact with existing router functionality, I'll dig into the connectors plugin itself later.
It's good overall, there's a few things that will need attention, but they're not blockers

fred = { version = "7.1.2", features = ["enable-rustls", "mocks"] }
futures-test = "0.3.30"
insta.workspace = true
json_value_merge = "2.0.0"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have internal code for this https://github.com/apollographql/router/blob/dev/apollo-router/src/json_ext.rs#L68-L96
At this point we should be careful about adding any new dependencies, because compilations is already too heavy


# See note above in this file about `^tracing` packages which also applies to
# these dev dependencies.
tracing-fluent-assertions = "0.3.0"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already use at least 2 other crates to test tracing and spans, is this one really needed?

};
};

($group: literal, $name: ident, $plugin_type: ident) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: instead of 2 different declarations with ident and literal, we should have only one with expr

.supergraph_request(parameters.supergraph_request.clone())
.variables(variables)
.current_dir(current_dir.clone())
.deferred_fetches(parameters.deferred_fetches.clone())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this clone will cause performance issues. The ExecutionParameters structure that uses references everywhere was introduced to avoid the clones during execution, which became expensive.
The only reason deferred_fetches is used in FetchNode::fetch_node is this:

if let Some(id) = &self.id {
if let Some(sender) = parameters.deferred_fetches.get(id.as_str()) {
tracing::info!(monotonic_counter.apollo.router.operations.defer.fetch = 1u64);
if let Err(e) = sender.clone().send((value.clone(), errors.clone())) {
tracing::error!("error sending fetch result at path {} and id {:?} for deferred response building: {}", current_dir, self.id, e);
}
}
}

That should be moved right here in execution.rs

Comment on lines +461 to +468
pub(crate) fn response_at_path<'a>(
schema: &Schema,
current_dir: &'a Path,
inverted_paths: Vec<Vec<Path>>,
response: graphql::Response,
requires: &[Selection],
output_rewrites: &Option<Vec<DataRewrite>>,
service_name: &str,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was self removed?

.and_connection_closed_signal(parameters.subscription_handle.as_ref().map(|s| s.closed_signal.resubscribe()))
.build();

// TODO[igni]: refactor so it uses fetchservice
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please open an issue to follow up on this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've filed issues for all comments on this PR, thank you!

.create(service_name)
.expect("we already checked that the service exists during planning; qed");
.subgraph_service_for_subscriptions(service_name)
.unwrap();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be an expect

@@ -0,0 +1,54 @@
#![allow(missing_docs)] // FIXME
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

let join_directive = value
.directives
.iter()
.find(|directive| directive.name.eq_ignore_ascii_case("join__graph"))?;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the directive name need to be case insensitive?

@lennyburdette
Copy link
Copy Markdown
Contributor Author

saw two things that can likely land in dev right away too

done in #5720

Copy link
Copy Markdown
Contributor

@dylan-apollo dylan-apollo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ready when you are :shipit:

@lennyburdette lennyburdette merged commit 9fa9cf0 into next Jul 30, 2024
@lennyburdette lennyburdette deleted the connectors branch July 30, 2024 19:08
@lennyburdette lennyburdette restored the connectors branch July 30, 2024 19:42
@lennyburdette lennyburdette deleted the connectors branch July 30, 2024 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants