Skip to content
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

[bug report] Change machine time , while app is running, will make cron task fall into fatally endless loop. #346

Open
fwhezfwhez opened this issue Oct 14, 2020 · 0 comments

Comments

@fwhezfwhez
Copy link

c.AddFunc("0 * * * * ?", QueryBalanceOver100)

Function QueryBalanceOver100 is expected to run once per minute. When app is running, and then, I change local time to tomorrow, this task will execute unexpected times in a short time.

Here is log, this repeated job drown my db connections:

[2020-10-17 14:07:59]  [2236.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it. 
2020-10-17 14:07:59 | G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:24 | dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it.

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2236.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it. 
2020-10-17 14:07:59 | G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:24 | dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it.

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2236.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it. 
2020-10-17 14:07:59 | G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:24 | dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it.

{
    "srv": "xyx_srv"
  }

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2238.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it. 
2020-10-17 14:07:59 | G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:24 | dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it.

{
    "srv": "xyx_srv"
  }

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2242.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it. 
2020-10-17 14:07:59 | G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:24 | dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it.

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2395.00ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2238.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2239.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2243.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2243.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2243.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
@fwhezfwhez fwhezfwhez changed the title [bug report] Change machine time , while app is running, will make cron in to fatally endless loop. [bug report] Change machine time , while app is running, will make cron task fall into fatally endless loop. Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant