sql-machine-learning / gomaxcompute

A Go driver for MaxCompute.
41 stars 11 forks source link

SQL jobs occasionally failed with 401 #27

Closed tonyyang-svail closed 5 years ago

tonyyang-svail commented 5 years ago

Error message

response error: 401, Unauthorized. The request authorization header is invalid or missing.

Reproduce

Run TestQuery many times.

Cause

The sign function in official ODPS Java SDK hashes the URL query parameters in alphabet order. ref

However, our implementation hashes simply by iterating over the parameter maps. However, Iterating over a map has no order guarantee.

weiguoz commented 5 years ago

Also, this PR fixed #20