Commit Graph

3438 Commits

Author SHA1 Message Date
Erik Arvidsson d4b412fa1f Rename MakeStructType2 to MakeStructType (#3304)
and remove the old MakeStructType
2017-03-29 15:04:26 -07:00
Erik Arvidsson c9e4a3af02 Resurrect MakeUnionType2 as MakeUnionTypeIntersectStructs (#3303)
This is needed by attic and it uses internal APIs so it has to be
exported 😢

A better path forward would be to fully implement intersection types
but that is a large change for an edge case feature.
2017-03-29 13:21:03 -07:00
cmasone-attic 3086084f77 Correctly create custom http.Transport in http_batch_store.go (#3302)
For the longest time, there's been a 'go vet' warning telling us that
when we build a custom http.Client in http_batch_store.go, we were
copying a Mutex down in there. That seems like not what you want to do.
Turns out we should be creating our own http.Transport object and
sharing that, instead of copying the default one every time we build
a new httpBatchStore.
2017-03-29 11:17:25 -07:00
Erik Arvidsson 2b669edcb3 ToUnresolvedType lost the optional flag (#3301) 2017-03-28 17:40:05 -07:00
Erik Arvidsson 1d56b95b21 IsSubtype more tests (#3299)
Adding more tests as I'm tracking down issues
2017-03-28 15:13:21 -07:00
Ben Kalman 3b82ab4ef1 Add missing .babelrc and .flowconfig (#3298) 2017-03-28 13:23:58 -07:00
Aaron Boodman 3315c31fe3 Update CONTRIBUTING.md 2017-03-28 10:32:41 -07:00
Sam Herrmann 7116bc0902 Remove Windows instructions from README.md (#3295) 2017-03-28 10:14:21 -07:00
Sam Herrmann 385d4e7bcd Fix v7 hyperlink in README.md (#3296) 2017-03-28 10:12:50 -07:00
Erik Arvidsson 22f70f585d Optional fields (#3287)
This adds optional fields to structs.

New version: 7.4

To create a struct type with optional fields use types.MakeStructType2

There are some API changes in this commit and there will be some more in followup commits.

Fixes #2327
2017-03-27 16:54:04 -07:00
Erik Arvidsson 7763b8b503 Remove OID (#3275)
Fixes #3121
2017-03-27 16:17:53 -07:00
Ben Kalman 3c764c1eb5 Remove JS SDK, examples, and tools (#3293) 2017-03-27 15:54:39 -07:00
cmasone-attic 44dd79d286 One more level of error unwrapping in s3_table_reader.go (#3292)
My mistake was assuming that, when a network read error happens, the
Err field of the resulting net.OpError would directly contain a
unix.Errno. What actually happens is that there's an *os.SyscallError
in there, which is the thing that's actually wrapped around the
unix.Errno. Hence, my `IsConnReset()` function was always returning
false.

This patch has been tested in the field, so I'm confident it will
work to mitigate #3255 in practice.
2017-03-24 11:59:42 -07:00
Erik Arvidsson 044c223f8a NGQL: Add work around for using a Set as a List (#3290)
If the GraphQL schema expects a List we also allow a Set.
2017-03-23 18:29:45 -07:00
Erik Arvidsson c89890ad0f Remove integration tests (#3288)
The integration tests requires js and go to be in sync which is not the
case for much longer. For now it fails the PR builder...
2017-03-22 14:41:14 -07:00
Erik Arvidsson 25cc6340ae Fix formatting errors
The <br> was causing the markdown to not render the images and links correct
2017-03-22 14:09:44 -07:00
Erik Arvidsson c48bd954f9 Add parser for Noms Types (#3277)
At this point it only parses the type syntax.

Towards #1466
2017-03-22 10:26:48 -07:00
Ben Kalman dadaf99b3c Remove unnecessary NewContext function/args (#3286) 2017-03-21 16:33:33 -07:00
Ben Kalman 6cffd88a4d Skip "original" field when marshaling type (#3285)
Instead of failing. Fixes https://github.com/attic-labs/noms/issues/3284
2017-03-20 19:27:54 -07:00
cmasone-attic 24ef78ea4b Test for the correct kind of error in s3_table_reader.go (#3282)
A connection reset doesn't get caught by io.ReadFull and converted to
an io.ErrUnexpectedEOF like I thought.  So, I need to try to type
assert the error I get to *net.OpError and then use that to see if it
was a connection reset.

Workaround for #3255
2017-03-20 16:42:59 -06:00
cmasone-attic 70670c0a6c Log error type when S3 reads fail (#3281)
Apparently, not all failures while reading get translated to
an ErrUnexpectedEOF. In order to figure out what error we see
in practice in s3_table_reader.go, log the type.
2017-03-20 13:54:22 -06:00
Rafael Weinstein e150a7a172 Update README.md 2017-03-19 14:08:25 -07:00
cmasone-attic 871a794ea9 Roll to latest testify (#3279) 2017-03-17 13:48:39 -07:00
cmasone-attic 69c351affa Remove ChunkStore backpressure mechanism (#3278)
This was something that evolved from the way that Dynamo stores
data, and a way to allow clients to make incremental write
progress. We never actually made the clients handle it
properly, though, and so much has changed since we wrote it
that it's only going to be in the way of building something
better.

Fixes #3234
2017-03-17 12:54:58 -07:00
Erik Arvidsson ab1b422ddf Update graphiql dependency (#3276)
Hopefully it will fix my startup crash...
2017-03-17 11:24:29 -07:00
cmasone-attic 02b90c968a Add retries to S3 reading (#3274)
We hit the point of diminishing returns with #3255.
Just do retries with an exponential backoff, logging
failures so we can at least go back in logs and see
how often we see this failure in future, and if we
get storms of retries or not.
2017-03-16 12:30:21 -07:00
Erik Arvidsson ba3fcfc14c NGQL: Handle null better in input data (#3272)
Struct fields are not allowed to be null or missing.

Lists/Sets may not contain null.
2017-03-15 16:04:18 -07:00
Erik Arvidsson fc781544e6 Support variables in our graphiql ui (#3271) 2017-03-15 14:03:06 -07:00
cmasone-attic 37138766c3 Revert "Land simpler network connection logging for #3255" (#3270)
This reverts commit 151521610e617c0156a649c73dcf2f2e76149ed6.

This logging didn't provide any further insight into #3255 :-/
2017-03-14 14:30:21 -07:00
cmasone-attic 47d0fa38df Land simpler network connection logging for #3255 (#3269)
Trying to run `ss` in a background process on every request wound up
opening too many FDs. This is because, in order to read stderr and
stdout from the child process, the server process needed to open a
couple of pipes. For every single one. Unless they exited VERY
fast, that means that there'd be many of these child processes alive
at the same time, each requiring 2 FDs -- and this is in addition to
the incoming network connections the server is handling and all its
connections to S3.

Whoops.

This patch only spins up `ss` in the event that a request has already
failed during read. The downside is that we're getting a snapshot from
_after_ the failure. The upside is that it's likely to actually
function! The hope is that the situation that lead to the read failing
persists long enough that we can see it even when sampling just after
the failure. Maybe not, but hopefully it's a start on figuring out
2017-03-14 12:26:05 -07:00
cmasone-attic b32cf24b11 Revert "Add network connection logging (#3266)" (#3268)
This reverts commit 1b439af7ff.

We're getting a "too many open files" issue with this `ss` tool
2017-03-14 11:22:38 -07:00
Erik Arvidsson 1911cbdd4a Refactor ngql to use an object with some state (#3267)
And introduce a way to provide a naming function so that we can
create names that are stable
2017-03-14 09:51:53 -07:00
cmasone-attic 1b439af7ff Add network connection logging (#3266)
Run a tool called `ss` in the background while making s3 requests. Log the output iff reading from S3 fails in the manner that we're trying to diagnose in #3255
2017-03-13 18:58:53 -07:00
Erik Arvidsson f50300d2e0 NGQL: Export TypeMap (#3265)
Go vet was right. Having a function return a non exported type was going
to cause pain.
2017-03-13 11:21:28 -07:00
Erik Arvidsson 4f96c5a7b2 Expose more functions of ngql (#3264)
This exports a few functions so that we can pass variables into
the query:

 - NewRootQueryObject (was constructQueryType)
 - GetTypeName
 - GetInputTypeName
 - InputToNomsValue (was argToNomsValue)
2017-03-10 17:45:50 -08:00
Erik Arvidsson 634b6833b9 Noms type to GraphQL input types (#3263)
* Noms type to GraphQL input types

We already had a way to generate GraphQL output types from Noms types
but no way to do input types. Input types are used in arguments
position.

We currently do not do any conversion from the JSON like data in
argument position. We leave it to the users to determine if they want
to convert the data into noms data structures or go to Go structures
or operate directly on the JSON like data.

* Introduce argToNomsValue

Using `marshal.Marshal` is not going to work because structs are done as
`map[string]interface{}` in GraphQL input types.

Instead introduce argToNomsValue which correctly handles
GraphQL -> Noms correctly even for structs.
2017-03-10 11:44:44 -08:00
Erik Arvidsson e5aede8801 Make GraphQL struct fields nullable (#3261)
This is needed because we do not have optional fields in noms structs.
Therefore the noms struct type has the field but the the noms struct may
not have it.
2017-03-09 10:46:58 -08:00
Dan Willhite 1e9bb40c44 Add HasHead function to dataset (#3262) 2017-03-08 18:29:12 -08:00
Erik Arvidsson 699c48cefa Make GraphQL tests not depend on JSON serialization (#3238)
Instead compare the logical value the JSON represents
2017-03-08 15:08:00 -08:00
cmasone-attic 7ac08e0ad1 the ID is in the _response_ (#3260) 2017-03-08 08:08:01 -08:00
cmasone-attic 8a80f7381f Apparently, there are TWO ids they need to debug. (#3259) 2017-03-08 07:27:09 -08:00
Aaron Boodman b36dbf4308 Update CONTRIBUTING.md 2017-03-07 13:45:43 -08:00
cmasone-attic 873422075a fix up logging format (#3257) 2017-03-07 13:37:00 -08:00
cmasone-attic 3372753705 Add Request ID to logging when S3 reads fail (#3256)
The AWS support people need this ID to dig into logs.

Fixes #3206
2017-03-07 12:43:56 -08:00
cmasone-attic 7b24f1cf3d Roll aws sdk to v1.7.4 (#3254) 2017-03-07 10:53:48 -08:00
Erik Arvidsson 87e7596c56 Add TypeMarshaler interface (#3251)
This allows go structs to participate in the MarshalType flow even
when they implement the Marshaler interface or if they have an original
tag.
2017-03-03 17:38:36 -08:00
Ben Kalman 5e7bf33a93 Make some ngql methods public (#3250) 2017-03-03 15:38:56 -08:00
Erik Arvidsson af87b68f91 GraphQL: Do not do read ahead when count is 1 (#3249)
When doing a query like

```graphql
values(count:1)
```

We used to do a read ahead. This removes that read ahead.

Towards #3236
2017-03-03 14:46:14 -08:00
Erik Arvidsson 7809dae58a GraphQL: Map values can be null when using keys arg (#3248)
When using keys it is possible that the key is not present. If that is
the case the value we return is null.
2017-03-03 14:17:32 -08:00
Ben Kalman 538237cdbe Support other endpoints and extra args in GraphiQL (#3246) 2017-03-03 10:28:14 -08:00