[ 
https://issues.apache.org/jira/browse/AURORA-1083?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15005190#comment-15005190
 ] 

John Sirois commented on AURORA-1083:
-------------------------------------

I can and have [fixed up 
tests|https://github.com/jsirois/aurora/commit/6caf8c76dd16347f16ea2866f6735a51401cb700]
 to use {{s/set/frozenset/}}, {{s/list/tuple/}}, and {{\{\} \-> None}}, but 
there are real production issues with 0.9.2 and 0.9.3 using 
{{--gen=py:newstyle}}.

Here's a read on the python side from the server and a crash during set 
deserialization:
{noformat}
$ bash src/test/sh/org/apache/aurora/e2e/test_end_to_end.sh
...
 INFO] Retrieving jobs for role vagrant
Traceback (most recent call last):
  File "apache/aurora/client/api/scheduler_client.py", line 299, in 
method_wrapper
    resp = method(*(args + auth_args))
  File 
"/home/vagrant/.pex/install/api.src.main.thrift.org.apache.aurora.gen._api_342cf193-0.0.0-py2-none-any.whl.715d97ce4ff18af847651b06bdaacfd2141607dd/api.src.main.thrift.org.apache.aurora.gen._api_342cf193-0.0.0-py2-none-any.whl/gen/apache/aurora/api/ReadOnlyScheduler.py",
 line 347, in getJobs
    return self.recv_getJobs()
  File 
"/home/vagrant/.pex/install/api.src.main.thrift.org.apache.aurora.gen._api_342cf193-0.0.0-py2-none-any.whl.715d97ce4ff18af847651b06bdaacfd2141607dd/api.src.main.thrift.org.apache.aurora.gen._api_342cf193-0.0.0-py2-none-any.whl/gen/apache/aurora/api/ReadOnlyScheduler.py",
 line 366, in recv_getJobs
    result.read(iprot)
  File 
"/home/vagrant/.pex/install/api.src.main.thrift.org.apache.aurora.gen._api_342cf193-0.0.0-py2-none-any.whl.715d97ce4ff18af847651b06bdaacfd2141607dd/api.src.main.thrift.org.apache.aurora.gen._api_342cf193-0.0.0-py2-none-any.whl/gen/apache/aurora/api/ReadOnlyScheduler.py",
 line 1602, in read
    self.success.read(iprot)
  File 
"/home/vagrant/.pex/install/api.src.main.thrift.org.apache.aurora.gen._api_342cf193-0.0.0-py2-none-any.whl.715d97ce4ff18af847651b06bdaacfd2141607dd/api.src.main.thrift.org.apache.aurora.gen._api_342cf193-0.0.0-py2-none-any.whl/gen/apache/aurora/api/ttypes.py",
 line 7597, in read
    self.result.read(iprot)
  File 
"/home/vagrant/.pex/install/api.src.main.thrift.org.apache.aurora.gen._api_342cf193-0.0.0-py2-none-any.whl.715d97ce4ff18af847651b06bdaacfd2141607dd/api.src.main.thrift.org.apache.aurora.gen._api_342cf193-0.0.0-py2-none-any.whl/gen/apache/aurora/api/ttypes.py",
 line 7224, in read
    self.getJobsResult.read(iprot)
  File 
"/home/vagrant/.pex/install/api.src.main.thrift.org.apache.aurora.gen._api_342cf193-0.0.0-py2-none-any.whl.715d97ce4ff18af847651b06bdaacfd2141607dd/api.src.main.thrift.org.apache.aurora.gen._api_342cf193-0.0.0-py2-none-any.whl/gen/apache/aurora/api/ttypes.py",
 line 3901, in read
    self.configs.add(_elem114)
  File 
"/home/vagrant/.pex/install/api.src.main.thrift.org.apache.aurora.gen._api_342cf193-0.0.0-py2-none-any.whl.715d97ce4ff18af847651b06bdaacfd2141607dd/api.src.main.thrift.org.apache.aurora.gen._api_342cf193-0.0.0-py2-none-any.whl/gen/apache/aurora/api/ttypes.py",
 line 2565, in __hash__
    value = (value * 31) ^ hash(self.taskConfig)
  File 
"/home/vagrant/.pex/install/api.src.main.thrift.org.apache.aurora.gen._api_342cf193-0.0.0-py2-none-any.whl.715d97ce4ff18af847651b06bdaacfd2141607dd/api.src.main.thrift.org.apache.aurora.gen._api_342cf193-0.0.0-py2-none-any.whl/gen/apache/aurora/api/ttypes.py",
 line 2420, in __hash__
    value = (value * 31) ^ hash(self.constraints)
TypeError: unhashable type: 'set'
{noformat}

The relevant bug appears to be here: 
https://issues.apache.org/jira/browse/THRIFT-3388

My only workaround idea is using this new stuff:
{noformat}
$ thrift -help
...
    dynamic:         Generate dynamic code, less code generated but slower.
    dynbase=CLS      Derive generated classes from class CLS instead of TBase.
    dynexc=CLS       Derive generated exceptions from CLS instead of 
TExceptionBase.
    dynimport='from foo.bar import CLS'
                     Add an import line to generated code to find the dynbase 
class.
...
{noformat}

But that's based on little but the sound of the options names and a quick skim 
of https://issues.apache.org/jira/browse/THRIFT-1115 where these were 
introduced.

I'm going to stop work on this and wait to hear back how badly the new features 
are needed.  It seems to me the only sane path forward is to work on 
https://issues.apache.org/jira/browse/THRIFT-3388 and consume 0.9.4 when it is 
released.

> Upgrade to thrift 0.9.2
> -----------------------
>
>                 Key: AURORA-1083
>                 URL: https://issues.apache.org/jira/browse/AURORA-1083
>             Project: Aurora
>          Issue Type: Task
>            Reporter: Bill Farner
>            Assignee: John Sirois
>              Labels: newbie
>
> It's a point release, but includes a large number of changes: 
> https://git-wip-us.apache.org/repos/asf?p=thrift.git;a=blob_plain;f=CHANGES;hb=HEAD



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to