-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong return count from function created by MakeFunc #2
Comments
很抱歉,由于目前在忙别的工作,确实很久没有更新该client库了。
从上述报错信息来看,应该是使用 你也可以按以下指引先跑一遍测试用例看看 # 克隆并编译servicecomb-pack项目
$ git clone https://github.com/apache/servicecomb-pack.git
$ cd servicecomb-pack
$ mvn clean install -P 'mysql,!docker' -DskipTests=true
# 初始化alpha-server依赖的数据库
$ mysql -uroot -proot -h127.0.0.1 -P3306
MariaDB [(none)]> create database saga;
Query OK, 1 row affected (0.005 sec)
MariaDB [(none)]> grant all privileges on saga.* to saga@'localhost' identified by 'saga';
Query OK, 0 rows affected (0.045 sec)
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> use saga
Database changed
MariaDB [saga]> source alpha/alpha-server/src/main/resources/schema-mysql.sql
MariaDB [saga]> exit
Bye
# 启动alpha-server
$ java -Dspring.profiles.active=mysql -D"spring.datasource.url=jdbc:mysql://127.0.0.1:3306/saga?useSSL=false" -D"spring.datasource.password=saga" -jar alpha/alpha-server/target/saga/alpha-server-0.6.0-SNAPSHOT-exec.jar 另开一个shell终端,执行以下命令: # 克隆matrix-go-client项目并切换工作目录至matrix-saga-go目录
$ git clone https://github.com/jeremyxu2010/matrix-saga-go.git
$ cd matrix-saga-go
# 使用go mod下载go module依赖
$ go mod download
# 运行测试用例,可以看到转帐过程中,foo和bar的帐户余额出现了短暂的不一致,但后面又达到了最终一致性,符合saga分布式事务的设计理念
$ go run test/sagatx_demo.go
foo balance: 500, bar balance: 500
foo balance: 400, bar balance: 500
foo balance: 500, bar balance: 500
foo balance: 500, bar balance: 500
...... 这个go client库是一年前做的,当时 |
我这边的原因是:
|
@xfye 你说得对,这里如发现是错误结果,应该将错误返回,以阻止继续执行targetFunc。还有几处类似的错误处理也有问题,这两天我抽空处理一下。感谢你的反馈! |
Here is a user issue apache/servicecomb-pack#548 in ServiceComb-Pack about using go-client to connect the alpha server.
@jeremyxu2010 Could you take a look at it?
The text was updated successfully, but these errors were encountered: