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

/api/config.reload doesn't update the result of /api/config.dump #1820

Closed
mururu opened this issue Jan 15, 2018 · 3 comments
Closed

/api/config.reload doesn't update the result of /api/config.dump #1820

mururu opened this issue Jan 15, 2018 · 3 comments
Assignees
Labels

Comments

@mururu
Copy link
Member

mururu commented Jan 15, 2018

Check CONTRIBUTING guideline first and here is the list to help us investigate the problem.

  • fluentd or td-agent version.

v1.0.x and v0.14.x

  • How to confirm it.
$ cat rpc.conf
<system>
  rpc_endpoint 0.0.0.0:24444
</system>
$ bundle exec bin/fluentd -c rpc.conf
2018-01-15 15:17:35 +0900 [info]: parsing config file is succeeded path="rpc.conf"
2018-01-15 15:17:35 +0900 [info]: using configuration file: <ROOT>
  <system>
    rpc_endpoint "0.0.0.0:24444"
  </system>
</ROOT>
2018-01-15 15:17:35 +0900 [info]: starting fluentd-1.0.2 pid=37868 ruby="2.4.1"
2018-01-15 15:17:35 +0900 [info]: spawn command to main:  cmdline=["/Users/yito/.rbenv/versions/2.4.1/bin/ruby", "-Eascii-8bit:ascii-8bit", "-rbundler/setup", "bin/fluentd", "-c", "rpc.conf", "--under-supervisor"]
2018-01-15 15:17:35 +0900 [info]: gem 'fluentd' version '1.0.2'
2018-01-15 15:17:35 +0900 [info]: #0 starting fluentd worker pid=37901 ppid=37868 worker=0
2018-01-15 15:17:35 +0900 [info]: #0 fluentd worker is now running worker=0

--- call /api/config.dump ---

2018-01-15 15:18:03 +0900 [info]: dump in-memory config
2018-01-15 15:18:03 +0900 [info]: <ROOT>
  <system>
    rpc_endpoint "0.0.0.0:24444"
  </system>
</ROOT>

--- echo 'abc' >> rpc.conf ---
--- call /api/config.reload ---

2018-01-15 15:19:22 +0900 [info]: #0 fluentd worker is now stopping worker=0
2018-01-15 15:19:22 +0900 [info]: #0 shutting down fluentd worker worker=0
2018-01-15 15:19:22 +0900 [info]: Worker 0 finished unexpectedly with status 0
2018-01-15 15:19:23 +0900 [info]: gem 'fluentd' version '1.0.2'
2018-01-15 15:19:23 +0900 [warn]: parameter 'abc' in <ROOT>
  abc
  <system>
    rpc_endpoint "0.0.0.0:24444"
  </system>
</ROOT> is not used.
2018-01-15 15:19:23 +0900 [info]: #0 starting fluentd worker pid=37980 ppid=37868 worker=0
2018-01-15 15:19:23 +0900 [info]: #0 fluentd worker is now running worker=0

--- call /api/config.dump ---

2018-01-15 15:19:52 +0900 [info]: dump in-memory config
2018-01-15 15:19:52 +0900 [info]: <ROOT>
  <system>
    rpc_endpoint "0.0.0.0:24444"
  </system>
</ROOT>
@fujimotos
Copy link
Member

I have investigated this issue and find that the current implementation
of /api/config.dump (and /api/config.getDump) is fairly broken.

The Root Problem

The root problem is that, the RPC server is running on a Server process
while only Worker processes know the actual configuration.

Since there is no IPC mechanism (except Unix signals) available for them
to communicate with each other, the RPC server, by design, never knows
the latest state of the configuration settings.

How can we fix this issue?

I can think of two ways to fix this, but I think neither is something
immediately feasible:

  1. Add a new Unix signal handler to dump configuration settings
  2. Implement a new IPC mechanism to allow communication between processes.

Probably, we'd better to disable these endpoints until they get fixed properly
(see also #1576). Provided that these endpoints are not documented,
degradation to users would be very small.

@ganmacs ganmacs self-assigned this Oct 24, 2019
@github-actions
Copy link

This issue has been automatically marked as stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 30 days

@github-actions github-actions bot added the stale label Jan 26, 2021
@github-actions
Copy link

This issue was automatically closed because of stale in 30 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants