[task] Fix some bugs for supporting thrift