You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The ruby driver silently ignores unknown optional arguments #2052
Sorry to resurrect a dead horse, but re-opening briefly to talk about the set of accepted global optargs.
The linked patch makes some global optargs which are currently accepted illegal. I'm not necessarily opposed to doing this, but it seems like a bad idea on the surface: it might break somebody's app and there's no real cost to accepting them. I could very easily see someone wanting to specify e.g. geo_system globally. It also seems strange that for some terms we now accept some but not all of their optargs at the global level. For example, you can set durability at the top level, but not non_atomic. I can imagine that being confusing.
@gchpaco By "accepting all opt args" I meant accepting all opt args that are accepted by at least one of the terms. So we would just extend the list, definitely not revert your change.
really easy to forget adding a new opt arg to the list in the future
If we do this, we should make the optargspec_t constructor guarantee that the optarg is in the global list. That way we'd get a crash the first time we tried to test a term using the new optarg.
having to specify opt args at the term where they are being used makes sure people understand which terms a given opt arg has effects on
Yeah. There are also some optargs which are just outright confusing at the toplevel (timeout doesn't specify a timeout for the whole query, it specifies the timeout for any r.js calls in the query).
If we do this, we should make the optargspec_t constructor guarantee that the optarg is in the global list. That way we'd get a crash the first time we tried to test a term using the new optarg.
Ah that's a good idea.
With that out of the way, I'm leaning towards having all opt args that are allowed somewhere to also be allowed globally.
Activity
mlucy commentedon Mar 4, 2014
I think this check should be done on the server rather than in the clients. That way third-party drivers get it for free.
coffeemug commentedon Aug 13, 2014
Assigning to @gchpaco
mlucy commentedon Aug 13, 2014
Note that optargs passed to
connectneed to be handled in the driver, but unknown global optional arguments should probably be rejected on the server.gchpaco commentedon Jan 7, 2015
Fix for the global optargs thing in CR 2436.
Merge branch 'gchpaco_2052' into next
gchpaco commentedon Jan 7, 2015
Should be solved now.
mlucy commentedon Jan 9, 2015
Sorry to resurrect a dead horse, but re-opening briefly to talk about the set of accepted global optargs.
The linked patch makes some global optargs which are currently accepted illegal. I'm not necessarily opposed to doing this, but it seems like a bad idea on the surface: it might break somebody's app and there's no real cost to accepting them. I could very easily see someone wanting to specify e.g.
geo_systemglobally. It also seems strange that for some terms we now accept some but not all of their optargs at the global level. For example, you can setdurabilityat the top level, but notnon_atomic. I can imagine that being confusing.danielmewes commentedon Jan 9, 2015
The current list is based on what the JavaScript driver used to allow as global opt args.
I personally am neutral on the question of whether to allow all opt args globally or only the selected ones.
3 remaining items
danielmewes commentedon Jan 9, 2015
@gchpaco By "accepting all opt args" I meant accepting all opt args that are accepted by at least one of the terms. So we would just extend the list, definitely not revert your change.
gchpaco commentedon Jan 9, 2015
OK.
mlucy commentedon Jan 9, 2015
If we do this, we should make the
optargspec_tconstructor guarantee that the optarg is in the global list. That way we'd get a crash the first time we tried to test a term using the new optarg.Yeah. There are also some optargs which are just outright confusing at the toplevel (
timeoutdoesn't specify a timeout for the whole query, it specifies the timeout for anyr.jscalls in the query).danielmewes commentedon Jan 9, 2015
Ah that's a good idea.
With that out of the way, I'm leaning towards having all opt args that are allowed somewhere to also be allowed globally.
gchpaco commentedon Jan 9, 2015
Okay.
mlucy commentedon Jan 9, 2015
That sounds slightly better to me too. All hail backwards compatibility!
gchpaco commentedon Jan 13, 2015
CR 2456.
Merge branch 'gchpaco_2052' into next
Merge branch 'gchpaco_2052' into next