8000 Change GET request to POST requests by peter-volkov · Pull Request #2732 · spotify/luigi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Change GET request to POST requests #2732

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

Merged
merged 1 commit into from
Jul 8, 2019
Merged

Conversation

peter-volkov
Copy link
Contributor
@peter-volkov peter-volkov commented Jun 27, 2019

GET requests should not have http body according to RFC.
Works well with POST here, and fails with GET for some cases:
2019-03-22 20:51:24,589 tornado.application[19] ERROR: Uncaught exception GET /api/add_task ...

Traceback (most recent call last):
File "contrib/python/tornado/tornado/web.py", line 1510, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "contrib/python/luigi/luigi/server.py", line 120, in get
result = getattr(self._scheduler, method)(**arguments)
File "contrib/python/luigi/luigi/scheduler.py", line 819, in add_task
assert worker is not None
AssertionError

By the way: urllib fetcher uses POST here (urlopen(full_url, body, timeout).)

Description

Motivation and Context

Have you tested this? If so, how?

I ran my jobs with this code and it works for me.

Get request should not have http body according to RFC.
Works well with POST here, and fails with GET for some cases:
2019-03-22 20:51:24,589 tornado.application[19] ERROR: Uncaught exception GET /api/add_task ...

Traceback (most recent call last):
  File "contrib/python/tornado/tornado/web.py", line 1510, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "contrib/python/luigi/luigi/server.py", line 120, in get
    result = getattr(self._scheduler, method)(**arguments)
  File "contrib/python/luigi/luigi/scheduler.py", line 819, in add_task
    assert worker is not None
AssertionError


By the way: urllib fetcher uses POST here (urlopen(full_url, body, timeout).)
@honnix
Copy link
Member
honnix commented Jun 27, 2019

Since this will be a breaking change, shall we support both methods for a few more versions? Of course we can mark the GET method as deprecated.

Please disregard my comment, we already do this: https://github.com/spotify/luigi/blob/master/luigi/server.py#L129

@peter-volkov
Copy link
Contributor Author

It is not a breaking change as I can see.
Im already using this fix in production. Any other info is needed from me?

@Tarrasch
Copy link
Contributor
Tarrasch commented Jul 2, 2019

Makes sense I suppose - honestly I don't know.

Can you just clarify when one gets the stack trace? For particular version of libraries or is it your task that is special?

@peter-volkov
Copy link
Contributor Author

I guess the thing is in third-party http-balancer that stands between luigi client and scheduler in my infrastructure. Maybe the balancer drops the http body. As far as I know it does not reproduce with http connection.
Anyway I would merge it for the sake of expected behavior.

@Tarrasch Tarrasch merged commit 38443c2 into spotify:master Jul 8, 2019
@Tarrasch
Copy link
Contributor
Tarrasch commented Jul 8, 2019

Thanks for this patch @peter-volkov !

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.

3 participants
0