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

WIP: Fix inits doing db IO #485

Closed

Conversation

lfdversluis
Copy link
Contributor

@lfdversluis lfdversluis commented Jun 3, 2016

__init__s no longer do DB IO (enhancement)

Fixes #484

@lfdversluis lfdversluis changed the title Issue 484 fix inits doing db io WIP: Fix inits doing db IO Jun 3, 2016
@lfdversluis
Copy link
Contributor Author

@devos50 can you review? (ignore the first commit, it will be dropped).

self._connection_type = u"unknown"

@inlineCallbacks
def initlialize(self, communityclass=DebugCommunity, c_master_member=None, curve=u"low"):
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a typo in the name of the method (should be initialize).

@devos50
Copy link
Contributor

devos50 commented Jun 3, 2016

@lfdversluis I gave some comments. Were this all occurrences of inits doing DB I/O btw?

@lfdversluis
Copy link
Contributor Author

What my function found out yes. It turned out that message -> Implementation class was called all the time so many stack traces were gone by fixing that one. This one will be a headache to refactor though once it gets a Deferred, but that's for another PR.

@lfdversluis lfdversluis force-pushed the issue-484-fix-inits-doing-db-io branch from 806e44d to 468ac15 Compare June 3, 2016 17:05
@lfdversluis lfdversluis changed the title WIP: Fix inits doing db IO READY: Fix inits doing db IO Jun 3, 2016
@lfdversluis
Copy link
Contributor Author

@whirm Ready for your review.

@lfdversluis lfdversluis force-pushed the issue-484-fix-inits-doing-db-io branch from 2d8264b to 8a317c9 Compare June 3, 2016 17:14
impl = self.Implementation(self, authentication_impl, resolution_impl, distribution_impl, destination_impl, payload_impl, *args, **kargs)
packet = ""
if "packet" in kargs:
packet = kargs["packet"]
Copy link
Contributor

Choose a reason for hiding this comment

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

you can do a kargs.get("packet", "")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh that will be much cleaner 👍

@whirm
Copy link
Contributor

whirm commented Jun 6, 2016

Yeah, it's not pretty but I guess it will have to do pending a major refactor...

@whirm
Copy link
Contributor

whirm commented Jun 6, 2016

have you run the Tribler tests with this branch?

@lfdversluis
Copy link
Contributor Author

@whirm No, I will do that after I fixed that line you commented on 👍

@whirm whirm changed the title READY: Fix inits doing db IO WIP: Fix inits doing db IO Jun 7, 2016
@lfdversluis
Copy link
Contributor Author

Tribler seems to run happy with this code, although one of the tests errored with a known error.

@lfdversluis lfdversluis changed the title WIP: Fix inits doing db IO READY: Fix inits doing db IO Jun 8, 2016
@whirm
Copy link
Contributor

whirm commented Jun 9, 2016

retest this please

@whirm
Copy link
Contributor

whirm commented Jun 9, 2016

Squash it!

@lfdversluis
Copy link
Contributor Author

lfdversluis commented Jun 9, 2016

@whirm Since the container appears to be unstable, can I somehow run these changes + tribler on BBQ? I would feel more comfortable knowing that the tests pass then. Before a bug was introduced after all and the container hid it.

@whirm
Copy link
Contributor

whirm commented Jun 9, 2016

@lfdversluis which container? yours or the test runner?

You can always run your own jobs on jenkins. Just set up one on /pers/

@whirm
Copy link
Contributor

whirm commented Jun 9, 2016

retest this please

@lfdversluis lfdversluis force-pushed the issue-484-fix-inits-doing-db-io branch from 3b8a8f7 to 4d512c3 Compare June 11, 2016 09:28
@whirm
Copy link
Contributor

whirm commented Jul 1, 2016

@lfdversluis can you rebase this?

@whirm whirm changed the title READY: Fix inits doing db IO WIP: Fix inits doing db IO Jul 1, 2016
@lfdversluis lfdversluis force-pushed the issue-484-fix-inits-doing-db-io branch from 4d512c3 to e4249a5 Compare July 13, 2016 17:40
@lfdversluis lfdversluis closed this May 3, 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.

Objects that do a database call in their init
3 participants