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

When i use reload command in consul agent, is that will clean up I've created session? #693

Closed
ahjdzx opened this issue Feb 12, 2015 · 4 comments
Labels
type/bug Feature does not function as expected

Comments

@ahjdzx
Copy link

ahjdzx commented Feb 12, 2015

I've created a session in consul agent, but when I executed the reload command, I found the session is not exists. Is that normal?

@armon
Copy link
Member

armon commented Feb 13, 2015

Can you clarify this a bit more? Details about the session creation, associated health checks, etc would be useful.

@ahjdzx
Copy link
Author

ahjdzx commented Feb 13, 2015

1.I register a service in consul agent:

curl -X PUT -d '{"Name":"innosql","Tags":["master"],"Port":3306,"Check":{"Script":"/root/mysqlcheck.sh","Interval":"10s"}}' http://192.168.2.64:8500/v1/agent/service/register

And, I exam the result use http://192.168.2.71:8500/v1/health/service/innosql

[
  {
    "Node": {
      "Node": "consul-agent4",
      "Address": "192.168.2.64"
    },
    "Service": {
      "ID": "innosql",
      "Service": "innosql",
      "Tags": [
        "master"
      ],
      "Port": 3306
    },
    "Checks": [
      {
        "Node": "consul-agent4",
        "CheckID": "service:innosql",
        "Name": "Service 'innosql' check",
        "Status": "passing",
        "Notes": "",
        "Output": "",
        "ServiceID": "innosql",
        "ServiceName": "innosql"
      },
      {
        "Node": "consul-agent4",
        "CheckID": "serfHealth",
        "Name": "Serf Health Status",
        "Status": "passing",
        "Notes": "",
        "Output": "Agent alive and reachable",
        "ServiceID": "",
        "ServiceName": ""
      }
    ]
  }
]

2.I create a session like this:

curl -X PUT -d '{"LockDelay":"15s","Name":"innosql","Node":"consul-agent4","Checks":["serfHealth","service:innosql"]}' http://192.168.2.71:8500/v1/session/create

result is:

{
   "ID": "fa9599ae-f4e4-8015-6325-cc9e1c83581e"
}

and use session/info api: http://192.168.2.71:8500/v1/session/info/fa9599ae-f4e4-8015-6325-cc9e1c83581e

[
  {
    "CreateIndex": 106383,
    "ID": "fa9599ae-f4e4-8015-6325-cc9e1c83581e",
    "Name": "innosql",
    "Node": "consul-agent4",
    "Checks": [
      "serfHealth",
      "service:innosql"
    ],
    "LockDelay": 15000000000,
    "Behavior": "release",
    "TTL": ""
  }
]

3.I reload the consul agent.

[root@consul-agent4 ~]# consul reload -rpc-addr=192.168.2.64:8400
Configuration reload triggered

4.Use session/info api: http://192.168.2.71:8500/v1/session/info/fa9599ae-f4e4-8015-6325-cc9e1c83581e again.
return null

Is that normal? Thank you for your answer!@armon

@armon
Copy link
Member

armon commented Feb 17, 2015

@ahjdzx Thanks for the detailed report! I see the issue, it is not expected behavior. Tagged as bug. Thanks!

@armon armon added the type/bug Feature does not function as expected label Feb 17, 2015
@armon armon closed this as completed in b319c41 Feb 17, 2015
armon added a commit that referenced this issue Feb 17, 2015
agent: Snapshot and restore health state on reload. Fixes #693
@armon
Copy link
Member

armon commented Feb 17, 2015

Should be fixed in master!

duckhan pushed a commit to duckhan/consul that referenced this issue Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Feature does not function as expected
Projects
None yet
Development

No branches or pull requests

2 participants