Skip to content

Conversation

@rchhaya
Copy link
Contributor

@rchhaya rchhaya commented Jul 29, 2022

No description provided.

@rchhaya
Copy link
Contributor Author

rchhaya commented Aug 9, 2022

Apologies for a ton of minor commits for compiler directive things - tried switching swiftenv but since I cant run on terminal (weird env problems, can only build via xcode), the version switch didnt actully cascade down. Should be all fixed now + working on resolving an issue with sharding

#if compiler(>=5.5.2) && canImport(_Concurrency)
import MongoSwift
import Nimble
import NIOPosix
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need the NIOPosix import?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, leftover from elg stuff during debugging. Removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

doesn't look like this actually got removed

Copy link
Contributor

Choose a reason for hiding this comment

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

This is actually needed in order to use MultiThreadedEventLoopGroup in this file.

@rchhaya rchhaya requested a review from kmahar August 15, 2022 18:01
Copy link
Contributor

@kmahar kmahar left a comment

Choose a reason for hiding this comment

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

thanks for addressing my comments! I have a few more mostly minor ones.

for (_, client) in clientMap {
for entity in collEntities {
_ = try client.db(entity.namespace.db).runCommand(
_ = try? await client.db(entity.namespace.db).runCommand(
Copy link
Contributor

Choose a reason for hiding this comment

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

hmmm, I'd still like to understand why this only shows up now and never came up when the runner was sync. it might point to some subtle behavioral difference we're missing that results from this refactor. I'd think that we should be doing the same operation in the same order we were before. could you maybe link me to an example evergreen run where this happens so I can see the output?

@rchhaya rchhaya requested a review from kmahar August 16, 2022 17:54
Copy link
Contributor

@kmahar kmahar left a comment

Choose a reason for hiding this comment

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

couple suggestions; otherwise LGTM mod ongoing thread about needing to try? the distinct workaround

Co-authored-by: Kaitlin Mahar <kaitlinmahar@gmail.com>
@rchhaya rchhaya requested a review from kmahar August 17, 2022 14:40
@@ -0,0 +1,49 @@
#if compiler(>=5.5.2) && canImport(_Concurrency)
import MongoSwift
import NIOPosix
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can get rid of the NIOPosix import

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, remnant from experimenting with EventLoopGroup stuff. Removed

)
} catch {
// DB not explicitly initially created for operation-failure test bc no initialData
if !(error is MongoError.CommandError) {
Copy link
Contributor

Choose a reason for hiding this comment

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

we can make this a little more specific actually, so that we don't ignore arbitrary command errors. the error code for NamespaceNotFound is 26.

let's do something like the logic here so that we only catch and ignore command errors with code 26:

} catch let commandError as MongoError.CommandError where commandError.code == 11601 {}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. Was struggling with the syntax earlier but this really helps. Done.

["distinct": .string(entity.name), "key": "_id"]
)
} catch {
// DB not explicitly initially created for operation-failure test bc no initialData
Copy link
Contributor

Choose a reason for hiding this comment

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

can we make this comment a little mores pecific? something like "this command can fail for tests that have no initialData specified and so do not create the namespace, such as the valid-fail/operation-failure.json test"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Moved comment to before the do/catch block

@rchhaya rchhaya requested a review from kmahar August 18, 2022 19:34
Copy link
Contributor

@patrickfreed patrickfreed left a comment

Choose a reason for hiding this comment

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

Looks really good! Just have a few minor comments

@rchhaya rchhaya requested a review from patrickfreed August 19, 2022 20:26
Copy link
Contributor

@isabelatkinson isabelatkinson left a comment

Choose a reason for hiding this comment

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

lgtm, just one nit

#if compiler(>=5.5.2) && canImport(_Concurrency)
import MongoSwift
import Nimble
import NIOPosix
Copy link
Contributor

Choose a reason for hiding this comment

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

doesn't look like this actually got removed

@patrickfreed patrickfreed merged commit 6c26d5e into mongodb:main Aug 30, 2022
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.

4 participants