Skip to content

Conversation

@josenavas
Copy link
Contributor

Built on top of #1202 (review/merge that one first).

This PR modifies the prep template object to reflect the changes in the DB. It also fixes the tests for the prep template object.

All the other tests expected to fail.

@josenavas josenavas added this to the Alpha 0.2 milestone May 24, 2015
@josenavas josenavas mentioned this pull request May 24, 2015
…Data is attached to it. Adding a test for it too
Copy link
Member

Choose a reason for hiding this comment

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

As a study can have several prep templates, this could cause collisions, could you change? Perhaps study.id + some random string.

Copy link
Contributor

Choose a reason for hiding this comment

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

These are just the queues though. Given that tornado is single threaded, is it possible for this block of code to be executed twice without the first queue draining?

Copy link
Member

Choose a reason for hiding this comment

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

Good point but this will not be the case if we allow for multi-threaded tornado or if we move this section to run as a separate IPython job. Better safe than sorry, no?

Copy link
Contributor

Choose a reason for hiding this comment

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

What would the benefit be of using a thread pool vs. just running multiple web servers? Threading adds a lot of complexity, and I doubt qiita is thread-safe anyway. IPython jobs do not have shared memory, so I do not understand your concern there. Doing something random because it "seems" safer does not inherently make it safer.

Copy link
Member

Choose a reason for hiding this comment

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

If you do not feel that is important and @josenavas thinks is fine, let's leave it as is ...

Copy link
Contributor

Choose a reason for hiding this comment

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

It isn't a feeling as there is a logical conclusion here, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree that is not likely to happen, however it is really easy to make it unique, so fixing because I think it can be a pain to try to debug an issue with this:

queue_name = "CREATE_PREP_TEMPLATE_%d_%d" % (study.id, id(md_template))

@antgonza
Copy link
Member

A couple of comments.

@josenavas
Copy link
Contributor Author

Thanks @antgonza , addressed your comments. One more reviewer so this can get merged?

@antgonza
Copy link
Member

👍

1 similar comment
@ElDeveloper
Copy link
Contributor

👍

ElDeveloper added a commit that referenced this pull request May 27, 2015
@ElDeveloper ElDeveloper merged commit dcdec1f into qiita-spots:fix-1084 May 27, 2015
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