7c0200c93b88898507dbafcb2d92314d0dbcd451,python/ray/serve/master.py,ServeMaster,create_backend,#ServeMaster#Any#Any#Any#Any#,269

Before Change


        self.backend_table.register_backend(backend_tag, backend_worker)

        // Save information about configurations needed to start the replicas.
        self.backend_table.register_info(backend_tag, backend_config_dict)

        // Save the initial arguments needed by replicas.
        self.backend_table.save_init_args(backend_tag, actor_init_args)

        // Set the backend config inside the router
        // (particularly for max-batch-size).
        [router] = self.get_router()
        await router.set_backend_config.remote(backend_tag,
                                               backend_config_dict)

        await self.scale_replicas(backend_tag,

After Change


            self._checkpoint()
            await self.http_proxy.set_route_table.remote(self.routes)

    async def create_backend(self, backend_tag, backend_config, func_or_class,
                             actor_init_args):
        Register a new backend under the specified tag.
        async with self.write_lock:
            backend_config_dict = dict(backend_config)
            backend_worker = create_backend_worker(func_or_class)

            // Save creator that starts replicas, the arguments to be passed in,
            // and the configuration for the backends.
            self.backends[backend_tag] = (backend_worker, actor_init_args,
                                          backend_config_dict)

            self._scale_replicas(backend_tag,
                                 backend_config_dict["num_replicas"])

            // NOTE(edoakes): we must write a checkpoint before starting new
            // or pushing the updated config to avoid inconsistent state if we
            // crash while making the change.
            self._checkpoint()
            await self._start_pending_replicas()
            await self._stop_pending_replicas()

            // Set the backend config inside the router
            // (particularly for max-batch-size).
            await self.router.set_backend_config.remote(
                backend_tag, backend_config_dict)

    async def set_backend_config(self, backend_tag, backend_config):
        Set the config for the specified backend.
        async with self.write_lock:
            assert (backend_tag in self.backends
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: ray-project/ray
Commit Name: 7c0200c93b88898507dbafcb2d92314d0dbcd451
Time: 2020-04-28
Author: ed.nmi.oakes@gmail.com
File Name: python/ray/serve/master.py
Class Name: ServeMaster
Method Name: create_backend


Project Name: ray-project/ray
Commit Name: 7c0200c93b88898507dbafcb2d92314d0dbcd451
Time: 2020-04-28
Author: ed.nmi.oakes@gmail.com
File Name: python/ray/serve/master.py
Class Name: ServeMaster
Method Name: set_backend_config


Project Name: ray-project/ray
Commit Name: 7c0200c93b88898507dbafcb2d92314d0dbcd451
Time: 2020-04-28
Author: ed.nmi.oakes@gmail.com
File Name: python/ray/serve/master.py
Class Name: ServeMaster
Method Name: create_backend


Project Name: ray-project/ray
Commit Name: 7c0200c93b88898507dbafcb2d92314d0dbcd451
Time: 2020-04-28
Author: ed.nmi.oakes@gmail.com
File Name: python/ray/serve/master.py
Class Name: ServeMaster
Method Name: set_traffic