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

Removes unnecessary 5th argument of the background job #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vatson
Copy link

@vatson vatson commented Nov 25, 2016

It's done to avoid the null terminator (NUL) in the end of payload.

Without this fix, node-gearman sends the one additional argument

Sending: SUBMIT_JOB_BG with 4 params
 -  <Buffer 00 52 45 51 00 00 00 12 00 00 01 96 6c 6f 79 61 6c 74 79 2d 66 65 65 64 73 00 00 7b 22 73 69 64 22 3a 22 31 31 32 22 2c 22 75 72 6c 22 3a 22 68 74 74 ... >
  - ARG:0  test
  - ARG:1  
  - ARG:2  {"foo":"bar"}
  - ARG:3  

The 4th argument is converted to the null terminator by gearman server and concatenated with payload. It is not obvious and causes an error "SyntaxError: Unexpected token" when trying to parse JSON

With this fix, debug output returns:

Sending: SUBMIT_JOB_BG with 3 params
 -  <Buffer 00 52 45 51 00 00 00 12 00 00 01 95 6c 6f 79 61 6c 74 79 2d 66 65 65 64 73 00 00 7b 22 73 69 64 22 3a 22 31 31 32 22 2c 22 75 72 6c 22 3a 22 68 74 74 ... >
  - ARG:0  test
  - ARG:1  
  - ARG:2  {"foo":"bar"}

@vatson
Copy link
Author

vatson commented Dec 19, 2016

Any news?

@andris9
Copy link
Owner

andris9 commented Dec 19, 2016

As the README says then this project is unmaintained. If you want to start managing it yourself then I could transfer the repo to your account.

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.

2 participants