Skip to content

return error instead of panic when type of time != float#57

Closed
nairboon wants to merge 1 commit intoinfluxdata:masterfrom
nairboon:master
Closed

return error instead of panic when type of time != float#57
nairboon wants to merge 1 commit intoinfluxdata:masterfrom
nairboon:master

Conversation

@nairboon
Copy link
Copy Markdown
Contributor

when the time field is a string the server panics. Now a 400 is returned: "Error: time field must be float but is ..."

2013/11/14 23:56:26 http: panic serving 127.0.0.1:34369: interface conversion: interface is string, not float64
goroutine 14 [running]:
net/http.func·007()
    /home/vagrant/bin/go/src/pkg/net/http/server.go:1022 +0xac
api/http.convertToDataStoreSeries(0xc2001ae2c0, 0x1, 0x600, 0x6bdec0, 0xc2001c7040, ...)
    /home/vagrant/influxdb/src/api/http/api.go:247 +0x235
api/http.func·002(0xc2001536c0, 0xc20017f1b0, 0xc200191354, 0x4, 0xc2001536c0, ...)
    /home/vagrant/influxdb/src/api/http/api.go:328 +0x29d
api/http.yieldUser(0xc2001536c0, 0xc20017f1b0, 0x7f5b47fd9c20, 0xc20019134d, 0x4, ...)
    /home/vagrant/influxdb/src/api/http/api.go:479 +0x39
api/http.(*HttpServer).tryAsDbUser(0xc2000f5120, 0xc2001ae000, 0xc200152d20, 0xc2000d2d00, 0x7f5b47fd9c20, ...)
    /home/vagrant/influxdb/src/api/http/api.go:680 +0x357
api/http.(*HttpServer).writePoints(0xc2000f5120, 0xc2001ae000, 0xc200152d20, 0xc2000d2d00)
    /home/vagrant/influxdb/src/api/http/api.go:340 +0x1fb
api/http.*HttpServer.(api/http.writePoints)·fm(0xc2001ae000, 0xc200152d20, 0xc2000d2d00)
    /home/vagrant/influxdb/src/api/http/api.go:67 +0x42
api/http.func·017(0xc2001ae000, 0xc200152d20, 0xc2000d2d00)
    /home/vagrant/influxdb/src/api/http/cors.go:13 +0x17e
net/http.HandlerFunc.ServeHTTP(0xc2000d0b20, 0xc2001ae000, 0xc200152d20, 0xc2000d2d00)
    /home/vagrant/bin/go/src/pkg/net/http/server.go:1149 +0x3e
github.com/bmizerany/pat.(*PatternServeMux).ServeHTTP(0xc2000004b8, 0xc2001ae000, 0xc200152d20, 0xc2000d2d00)
    /home/vagrant/influxdb/src/github.com/bmizerany/pat/mux.go:109 +0x1a4
net/http.serverHandler.ServeHTTP(0xc20015bbe0, 0xc2001ae000, 0xc200152d20, 0xc2000d2d00)
    /home/vagrant/bin/go/src/pkg/net/http/server.go:1517 +0x16c
net/http.(*conn).serve(0xc20019b120)
    /home/vagrant/bin/go/src/pkg/net/http/server.go:1096 +0x765
created by net/http.(*Server).Serve
    /home/vagrant/bin/go/src/pkg/net/http/server.go:1564 +0x266

@jvshahid jvshahid closed this in d45ad78 Nov 15, 2013
jvshahid pushed a commit that referenced this pull request Aug 12, 2014
fix peer stop channel problem
devanbenz pushed a commit that referenced this pull request Sep 16, 2024
* fix(tsi1/partition/test): fix data races in test code

This PR is like #24613 but solves it with a setter
method for MaxLogFileSize which allows unexporting that value and
MaxLogFileAge. There are actually two places locks were needed in test
code. The behavior of production code is unchanged.

(cherry picked from commit f0235c4daf4b97769db932f7346c1d3aecf57f8f)
devanbenz pushed a commit that referenced this pull request Sep 16, 2024
* fix(tsi1/partition/test): fix data races in test code

This PR is like #24613 but solves it with a setter
method for MaxLogFileSize which allows unexporting that value and
MaxLogFileAge. There are actually two places locks were needed in test
code. The behavior of production code is unchanged.

(cherry picked from commit f0235c4daf4b97769db932f7346c1d3aecf57f8f)
devanbenz added a commit that referenced this pull request Sep 16, 2024
* fix(tsi1/partition/test): fix data races in test code

This PR is like #24613 but solves it with a setter
method for MaxLogFileSize which allows unexporting that value and
MaxLogFileAge. There are actually two places locks were needed in test
code. The behavior of production code is unchanged.

(cherry picked from commit f0235c4daf4b97769db932f7346c1d3aecf57f8f)
devanbenz added a commit that referenced this pull request Sep 16, 2024
* fix(tsi1/partition/test): fix data races in test code

This PR is like #24613 but solves it with a setter
method for MaxLogFileSize which allows unexporting that value and
MaxLogFileAge. There are actually two places locks were needed in test
code. The behavior of production code is unchanged.

(cherry picked from commit f0235c4daf4b97769db932f7346c1d3aecf57f8f)
devanbenz added a commit that referenced this pull request Sep 17, 2024
* fix(tsi1/partition/test): fix data races in test code (#57)

* fix(tsi1/partition/test): fix data races in test code

This PR is like #24613 but solves it with a setter
method for MaxLogFileSize which allows unexporting that value and
MaxLogFileAge. There are actually two places locks were needed in test
code. The behavior of production code is unchanged.

(cherry picked from commit f0235c4daf4b97769db932f7346c1d3aecf57f8f)

* feat: modify error handling to be more idiomatic

closes #24042

* fix: errors.Join() filters nil errors

---------

Co-authored-by: Phil Bracikowski <13472206+philjb@users.noreply.github.com>
devanbenz added a commit that referenced this pull request Sep 17, 2024
* fix(tsi1/partition/test): fix data races in test code (#57)

* fix(tsi1/partition/test): fix data races in test code

This PR is like #24613 but solves it with a setter
method for MaxLogFileSize which allows unexporting that value and
MaxLogFileAge. There are actually two places locks were needed in test
code. The behavior of production code is unchanged.

(cherry picked from commit f0235c4daf4b97769db932f7346c1d3aecf57f8f)

* feat: modify error handling to be more idiomatic

closes #24042

* fix: errors.Join() filters nil errors

closes #25341
---------

Co-authored-by: Phil Bracikowski <13472206+philjb@users.noreply.github.com>
(cherry picked from commit 5c9e45f)
devanbenz added a commit that referenced this pull request Sep 17, 2024
* fix(tsi1/partition/test): fix data races in test code (#57)

* fix(tsi1/partition/test): fix data races in test code

This PR is like #24613 but solves it with a setter
method for MaxLogFileSize which allows unexporting that value and
MaxLogFileAge. There are actually two places locks were needed in test
code. The behavior of production code is unchanged.

(cherry picked from commit f0235c4daf4b97769db932f7346c1d3aecf57f8f)

* feat: modify error handling to be more idiomatic

closes #24042

* fix: errors.Join() filters nil errors

---------

Co-authored-by: Phil Bracikowski <13472206+philjb@users.noreply.github.com>
(cherry picked from commit 5c9e45f)
devanbenz added a commit that referenced this pull request Sep 17, 2024
…25345)

* feat: add hook for optimizing series reads based on authorizer (#25207)

* fix(tsi1/partition/test): fix data races in test code (#57) (#25338)

* fix(tsi1/partition/test): fix data races in test code (#57)

* fix(tsi1/partition/test): fix data races in test code

This PR is like #24613 but solves it with a setter
method for MaxLogFileSize which allows unexporting that value and
MaxLogFileAge. There are actually two places locks were needed in test
code. The behavior of production code is unchanged.

(cherry picked from commit f0235c4daf4b97769db932f7346c1d3aecf57f8f)

* feat: modify error handling to be more idiomatic

closes #24042

* fix: errors.Join() filters nil errors

---------

Co-authored-by: Phil Bracikowski <13472206+philjb@users.noreply.github.com>
(cherry picked from commit 5c9e45f)

---------

Co-authored-by: Geoffrey Wossum <gwossum@influxdata.com>
devanbenz added a commit that referenced this pull request Sep 17, 2024
…25344)

* fix(tsi1/partition/test): fix data races in test code (#57)

* fix(tsi1/partition/test): fix data races in test code

This PR is like #24613 but solves it with a setter
method for MaxLogFileSize which allows unexporting that value and
MaxLogFileAge. There are actually two places locks were needed in test
code. The behavior of production code is unchanged.

(cherry picked from commit f0235c4daf4b97769db932f7346c1d3aecf57f8f)

* feat: modify error handling to be more idiomatic

closes #24042

* fix: errors.Join() filters nil errors

closes #25341
---------

Co-authored-by: Phil Bracikowski <13472206+philjb@users.noreply.github.com>
(cherry picked from commit 5c9e45f)
devanbenz added a commit that referenced this pull request Sep 17, 2024
…25344)

* fix(tsi1/partition/test): fix data races in test code (#57)

* fix(tsi1/partition/test): fix data races in test code

This PR is like #24613 but solves it with a setter
method for MaxLogFileSize which allows unexporting that value and
MaxLogFileAge. There are actually two places locks were needed in test
code. The behavior of production code is unchanged.

(cherry picked from commit f0235c4daf4b97769db932f7346c1d3aecf57f8f)

* feat: modify error handling to be more idiomatic

closes #24042

* fix: errors.Join() filters nil errors

closes #25341
---------

Co-authored-by: Phil Bracikowski <13472206+philjb@users.noreply.github.com>
(cherry picked from commit 5c9e45f)
(cherry picked from commit b88e74e)

closes #25342
devanbenz added a commit that referenced this pull request Sep 17, 2024
…nstead of panic when type of time != float #57)

fix(tsi1/partition/test): fix data races in test code

This PR is like #24613 but solves it with a setter method for MaxLogFileSize which allows unexporting that value and MaxLogFileAge. There are actually two places locks were needed in test code. The behavior of production code is unchanged.

(cherry picked from commit f0235c4daf4b97769db932f7346c1d3aecf57f8f)

feat: modify error handling to be more idiomatic
closes #24042

fix: errors.Join() filters nil errors
closes #25341 ---------

Co-authored-by: Phil Bracikowski 13472206+philjb@users.noreply.github.com
(cherry picked from commit 5c9e45f) (cherry picked from commit b88e74e)

closes #25342
devanbenz added a commit that referenced this pull request Sep 17, 2024
* fix(tsi1/partition/test): fix data races in test code (#57)

* fix(tsi1/partition/test): fix data races in test code

This PR is like #24613 but solves it with a setter
method for MaxLogFileSize which allows unexporting that value and
MaxLogFileAge. There are actually two places locks were needed in test
code. The behavior of production code is unchanged.

(cherry picked from commit f0235c4daf4b97769db932f7346c1d3aecf57f8f)

* feat: modify error handling to be more idiomatic

closes #24042

* fix: errors.Join() filters nil errors

closes #25341
---------

Co-authored-by: Phil Bracikowski <13472206+philjb@users.noreply.github.com>
(cherry picked from commit 5c9e45f)
(cherry picked from commit b88e74e)

closes #25342
devanbenz added a commit that referenced this pull request Sep 17, 2024
#25352)

* fix(tsi1/partition/test): fix data races in test code (#57)

* fix(tsi1/partition/test): fix data races in test code

This PR is like #24613 but solves it with a setter
method for MaxLogFileSize which allows unexporting that value and
MaxLogFileAge. There are actually two places locks were needed in test
code. The behavior of production code is unchanged.

(cherry picked from commit f0235c4daf4b97769db932f7346c1d3aecf57f8f)

* feat: modify error handling to be more idiomatic

closes #24042

* fix: errors.Join() filters nil errors

closes #25341
---------

Co-authored-by: Phil Bracikowski <13472206+philjb@users.noreply.github.com>
(cherry picked from commit 5c9e45f)
(cherry picked from commit b88e74e)

closes #25342
devanbenz added a commit that referenced this pull request Oct 8, 2024
… (#25438)

* feat: add hook for optimizing series reads based on authorizer (#25207)

* fix(tsi1/partition/test): fix data races in test code (#57) (#25338)

* fix(tsi1/partition/test): fix data races in test code (#57)

* fix(tsi1/partition/test): fix data races in test code

This PR is like #24613 but solves it with a setter
method for MaxLogFileSize which allows unexporting that value and
MaxLogFileAge. There are actually two places locks were needed in test
code. The behavior of production code is unchanged.

(cherry picked from commit f0235c4daf4b97769db932f7346c1d3aecf57f8f)

* feat: modify error handling to be more idiomatic

closes #24042

* fix: errors.Join() filters nil errors

---------

Co-authored-by: Phil Bracikowski <13472206+philjb@users.noreply.github.com>
(cherry picked from commit 5c9e45f)

* fix(ci): Update test_pkgs_64bit image to non-eol ubuntu image (#25354)

* fix(ci): Update test_pkgs_64bit image to non-eol ubuntu image

* fix: trying edge img

* fix(ci): update ubuntu image in ci
Update test_pkgs_64bit image to non-eol ubuntu image

Please see: discuss.circleci.com/t/linux-image-deprecations-and-eol-for-2024/50177

closes #25355

(cherry picked from commit fdf0df7)

---------

Co-authored-by: Geoffrey Wossum <gwossum@influxdata.com>
mgattozzi added a commit that referenced this pull request Feb 10, 2025
This commit does two things:
1. It will load or create a license in the object store to be checked
   for validity.
2. It will validate that said license is not being used past the expiry
   date and spawn a task to continue validating that said license is
   valid
3. Disable querying endpoints so long as the license is expired

Note that:

1. This does work from local testing, but does not contain tests.
This is due to the fact that mocking it is hard to do without a valid
JWT token. For testing we will want to create a JWT for when a license
is expired or valid in the future.
2. This code will not work when run now unless you have a valid license,
create one locally with the license service, or you compile the code
with the `no-license` feature flag.

Closes #57
Closes #58
Closes #61
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.

1 participant