sxhxliang / mcp-access-point

Turn a web server into an MCP server in one click without making any code changes.
https://deepwiki.com/OpenAgentX/mcp-access-point
MIT License
71 stars 15 forks source link

Why 'Server starting' logs is printed 2 times? #5

Closed dhruv-bansal closed 1 month ago

dhruv-bansal commented 1 month ago

Why mcp-access-point is started - following logs are getting printed twice every time

[2025-05-18T22:02:38Z INFO  pingora_core::server] Server starting
[2025-05-18T22:02:38Z INFO  pingora_core::server] Server starting

Is that means pingora server is running twice?

sxhxliang commented 1 month ago

Would you mind sending me your full configuration file?

dhruv-bansal commented 1 month ago

Here is the complete config file


access_point:
  listeners:
    - address: 0.0.0.0:8080

mcps:
  - id: test
    upstream_id: 1
    path: https://petstore.swagger.io/v2/swagger.json

upstreams:
  - id: 1 
    nodes:
      "127.0.0.1:8091": 1
    scheme: https
    pass_host: preserve
sxhxliang commented 1 month ago

This is because this project depends on pingora, and the log is printed twice in its source code. https://github.com/cloudflare/pingora/blob/f69e2615d47236e68bcedcea29af951cbc7e9f60/pingora-core/src/server/mod.rs#L386

    /// Start the server using [Self::run] and default [RunArgs].
    pub fn run_forever(self) -> ! {
        info!("Server starting");

        self.run(RunArgs::default());

        info!("All runtimes exited, exiting now");
        std::process::exit(0)
    }

    /// Start the server
    ///
    /// This function will block forever until the server needs to quit. So this would be the last
    /// function to call for this object.
    ///
    /// Note: this function may fork the process for daemonization, so any additional threads created
    /// before this function will be lost to any service logic once this function is called.
    pub fn run(mut self, run_args: RunArgs) {
        info!("Server starting");

        let conf = self.configuration.as_ref();

        #[cfg(unix)]
        if conf.daemon {
            info!("Daemonizing the server");
            fast_timeout::pause_for_fork();
            daemonize(&self.configuration);
            fast_timeout::unpause();
        }
dhruv-bansal commented 1 month ago

thanks for the input @sxhxliang