Let Sidekiq and Que set provider_job_id #20056

Merged
merged 2 commits into from May 7, 2015

Conversation

Projects
None yet
6 participants
@jvanbaarsen
Contributor

jvanbaarsen commented May 7, 2015

When a job is added to Sidekiq or Que by ActiveJob, make sure we still can get the
original job_id provider by Sidekiq or Que. We do this by adding the Sidekiq jid or Que job_id to
provider_job_id field on the job object.

Partly fixes #18821

This PR is an extension on the PR submitted by @kddeisz : #19910

@seuros seuros added the activejob label May 7, 2015

@mperham

This comment has been minimized.

Show comment
Hide comment
@mperham

mperham May 7, 2015

Contributor

Thank you! This is a pretty critical integration point with Sidekiq since all its APIs require the JID to work.

Contributor

mperham commented May 7, 2015

Thank you! This is a pretty critical integration point with Sidekiq since all its APIs require the JID to work.

@jvanbaarsen jvanbaarsen changed the title from Let Sidekiq set provider_job_id to Let Sidekiq and Que set provider_job_id May 7, 2015

@jvanbaarsen

This comment has been minimized.

Show comment
Hide comment
@jvanbaarsen

jvanbaarsen May 7, 2015

Contributor

Added Que job_id reporting as well.

Contributor

jvanbaarsen commented May 7, 2015

Added Que job_id reporting as well.

@kddeisz

This comment has been minimized.

Show comment
Hide comment
@kddeisz

kddeisz May 7, 2015

Contributor

Nice work @jvanbaarsen

Contributor

kddeisz commented May 7, 2015

Nice work @jvanbaarsen

@rafaelfranca

This comment has been minimized.

Show comment
Hide comment
@rafaelfranca

rafaelfranca May 7, 2015

Member

@jvanbaarsen could you rebase your branch? Thanks

Member

rafaelfranca commented May 7, 2015

@jvanbaarsen could you rebase your branch? Thanks

@jvanbaarsen

This comment has been minimized.

Show comment
Hide comment
@jvanbaarsen

jvanbaarsen May 7, 2015

Contributor

@rafaelfranca Yes! will do

Contributor

jvanbaarsen commented May 7, 2015

@rafaelfranca Yes! will do

Let Sidekiq set provider_job_id
When a job is added to Sidekiq by ActiveJob, make sure we still can get the
original job_id provider by Sidekiq. We do this by adding the sidekiq jid to
provider_job_id field on the job object.

Partly fixes #18821

Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
@kddeisz

This comment has been minimized.

Show comment
Hide comment
@kddeisz

kddeisz May 7, 2015

Contributor

You might also want to make your adapter tests use the same test as the
delayed job one now - and just check for not null. We don't need both tests.

On Thu, May 7, 2015 at 3:48 PM, Jeroen van Baarsen <notifications@github.com

wrote:

@rafaelfranca https://github.com/rafaelfranca Yes! will do


Reply to this email directly or view it on GitHub
#20056 (comment).

Kevin D. Deisz
TrialNetworks - part of DrugDev
Software Developer
383 Elliot Street, Suite G
Newton, MA 02464
+1 617.952.4071 x134 (office)
+1 703.615.0396 (mobile)
kdeisz@trialnetworks.com

Contributor

kddeisz commented May 7, 2015

You might also want to make your adapter tests use the same test as the
delayed job one now - and just check for not null. We don't need both tests.

On Thu, May 7, 2015 at 3:48 PM, Jeroen van Baarsen <notifications@github.com

wrote:

@rafaelfranca https://github.com/rafaelfranca Yes! will do


Reply to this email directly or view it on GitHub
#20056 (comment).

Kevin D. Deisz
TrialNetworks - part of DrugDev
Software Developer
383 Elliot Street, Suite G
Newton, MA 02464
+1 617.952.4071 x134 (office)
+1 703.615.0396 (mobile)
kdeisz@trialnetworks.com

@jvanbaarsen

This comment has been minimized.

Show comment
Hide comment
@jvanbaarsen

jvanbaarsen May 7, 2015

Contributor

@kddeisz Ah yeah, good point! Will do as well

Contributor

jvanbaarsen commented May 7, 2015

@kddeisz Ah yeah, good point! Will do as well

@jvanbaarsen

This comment has been minimized.

Show comment
Hide comment
@jvanbaarsen

jvanbaarsen May 7, 2015

Contributor

@rafaelfranca You want me to squash the commits as well?

Contributor

jvanbaarsen commented May 7, 2015

@rafaelfranca You want me to squash the commits as well?

@rafaelfranca

This comment has been minimized.

Show comment
Hide comment
@rafaelfranca

rafaelfranca May 7, 2015

Member

It is fine these two commits

Member

rafaelfranca commented May 7, 2015

It is fine these two commits

activejob/CHANGELOG.md
@@ -1,3 +1,8 @@
+* Allow `Sidekiq` and `que` to report the job id back to `ActiveJob::Base` as

This comment has been minimized.

@rafaelfranca

rafaelfranca May 7, 2015

Member

Instead of adding a new entry maybe we should change the entry bellow. WDYT?

@rafaelfranca

rafaelfranca May 7, 2015

Member

Instead of adding a new entry maybe we should change the entry bellow. WDYT?

This comment has been minimized.

@jvanbaarsen

jvanbaarsen May 7, 2015

Contributor

@rafaelfranca Yes sounds good.

@jvanbaarsen

jvanbaarsen May 7, 2015

Contributor

@rafaelfranca Yes sounds good.

This comment has been minimized.

@kddeisz

kddeisz May 7, 2015

Contributor

Seems fine

@kddeisz

kddeisz May 7, 2015

Contributor

Seems fine

This comment has been minimized.

@kddeisz

kddeisz May 7, 2015

Contributor

While we're here, are there any other adapters that need this? resque?

On Thu, May 7, 2015 at 3:58 PM, Jeroen van Baarsen <notifications@github.com

wrote:

In activejob/CHANGELOG.md
#20056 (comment):

@@ -1,3 +1,8 @@
+* Allow Sidekiq and que to report the job id back to ActiveJob::Base as

@rafaelfranca https://github.com/rafaelfranca Yes sounds good.


Reply to this email directly or view it on GitHub
https://github.com/rails/rails/pull/20056/files#r29889786.

Kevin D. Deisz
TrialNetworks - part of DrugDev
Software Developer
383 Elliot Street, Suite G
Newton, MA 02464
+1 617.952.4071 x134 (office)
+1 703.615.0396 (mobile)
kdeisz@trialnetworks.com

@kddeisz

kddeisz May 7, 2015

Contributor

While we're here, are there any other adapters that need this? resque?

On Thu, May 7, 2015 at 3:58 PM, Jeroen van Baarsen <notifications@github.com

wrote:

In activejob/CHANGELOG.md
#20056 (comment):

@@ -1,3 +1,8 @@
+* Allow Sidekiq and que to report the job id back to ActiveJob::Base as

@rafaelfranca https://github.com/rafaelfranca Yes sounds good.


Reply to this email directly or view it on GitHub
https://github.com/rails/rails/pull/20056/files#r29889786.

Kevin D. Deisz
TrialNetworks - part of DrugDev
Software Developer
383 Elliot Street, Suite G
Newton, MA 02464
+1 617.952.4071 x134 (office)
+1 703.615.0396 (mobile)
kdeisz@trialnetworks.com

Make que report back its job_id to provider_job_id
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Fixes #18821.
- *Kevin Deisz*
+ *Kevin Deisz* And *Jeroen van Baarsen*

This comment has been minimized.

@jvanbaarsen

jvanbaarsen May 7, 2015

Contributor

@kddeisz you agree with this?

@jvanbaarsen

jvanbaarsen May 7, 2015

Contributor

@kddeisz you agree with this?

This comment has been minimized.

@kddeisz

kddeisz May 7, 2015

Contributor

I'm fine with that!

On Thu, May 7, 2015 at 4:00 PM, Jeroen van Baarsen <notifications@github.com

wrote:

In activejob/CHANGELOG.md
#20056 (comment):

 Fixes #18821.
  • Kevin Deisz
  • Kevin Deisz And Jeroen van Baarsen

@kddeisz https://github.com/kddeisz you agree with this?


Reply to this email directly or view it on GitHub
https://github.com/rails/rails/pull/20056/files#r29889974.

Kevin D. Deisz
TrialNetworks - part of DrugDev
Software Developer
383 Elliot Street, Suite G
Newton, MA 02464
+1 617.952.4071 x134 (office)
+1 703.615.0396 (mobile)
kdeisz@trialnetworks.com

@kddeisz

kddeisz May 7, 2015

Contributor

I'm fine with that!

On Thu, May 7, 2015 at 4:00 PM, Jeroen van Baarsen <notifications@github.com

wrote:

In activejob/CHANGELOG.md
#20056 (comment):

 Fixes #18821.
  • Kevin Deisz
  • Kevin Deisz And Jeroen van Baarsen

@kddeisz https://github.com/kddeisz you agree with this?


Reply to this email directly or view it on GitHub
https://github.com/rails/rails/pull/20056/files#r29889974.

Kevin D. Deisz
TrialNetworks - part of DrugDev
Software Developer
383 Elliot Street, Suite G
Newton, MA 02464
+1 617.952.4071 x134 (office)
+1 703.615.0396 (mobile)
kdeisz@trialnetworks.com

@jvanbaarsen

This comment has been minimized.

Show comment
Hide comment
@jvanbaarsen

jvanbaarsen May 7, 2015

Contributor

@rafaelfranca I think its ready to be merged (Once the tests are green 💃 )

Contributor

jvanbaarsen commented May 7, 2015

@rafaelfranca I think its ready to be merged (Once the tests are green 💃 )

rafaelfranca added a commit that referenced this pull request May 7, 2015

Merge pull request #20056 from jvanbaarsen/sidekiq-job-id
Let Sidekiq and Que set provider_job_id

@rafaelfranca rafaelfranca merged commit d19d79e into rails:master May 7, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jvanbaarsen jvanbaarsen deleted the jvanbaarsen:sidekiq-job-id branch May 7, 2015

@mperham

This comment has been minimized.

Show comment
Hide comment
@mperham

mperham May 7, 2015

Contributor

Will this get into 4.2 or 5+ only?

Contributor

mperham commented May 7, 2015

Will this get into 4.2 or 5+ only?

@rafaelfranca

This comment has been minimized.

Show comment
Hide comment
@rafaelfranca

rafaelfranca May 7, 2015

Member

5+ only.

Member

rafaelfranca commented May 7, 2015

5+ only.

@diddeb

This comment has been minimized.

Show comment
Hide comment
@diddeb

diddeb May 20, 2015

@mperham So, in current versions there's no way to find the underlying jid from Sidekiq using ActiveJob?

diddeb commented May 20, 2015

@mperham So, in current versions there's no way to find the underlying jid from Sidekiq using ActiveJob?

@mperham

This comment has been minimized.

Show comment
Hide comment
@mperham

mperham May 20, 2015

Contributor

Not that I'm aware of.

On May 20, 2015, at 05:58, Didde Brockman notifications@github.com wrote:

@mperham So, in current versions there's no way to find the underlying jid from Sidekiq using ActiveJob?


Reply to this email directly or view it on GitHub.

Contributor

mperham commented May 20, 2015

Not that I'm aware of.

On May 20, 2015, at 05:58, Didde Brockman notifications@github.com wrote:

@mperham So, in current versions there's no way to find the underlying jid from Sidekiq using ActiveJob?


Reply to this email directly or view it on GitHub.

@jvanbaarsen

This comment has been minimized.

Show comment
Hide comment
@jvanbaarsen

jvanbaarsen May 20, 2015

Contributor

@diddeb Not out of the box. Only way you can achieve this, is by monkeypatching.

Contributor

jvanbaarsen commented May 20, 2015

@diddeb Not out of the box. Only way you can achieve this, is by monkeypatching.

@diddeb

This comment has been minimized.

Show comment
Hide comment
@diddeb

diddeb May 20, 2015

Thanks @jvanbaarsen + @mperham... Freedom Patching it is.

diddeb commented May 20, 2015

Thanks @jvanbaarsen + @mperham... Freedom Patching it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment