Repository: dbt-labs/dbt-core

Issue:
[CT-954] [Bug] lastest main will break dbt-rpc 
### Is this a new bug in dbt-core?

- [X] I believe this is a new bug in dbt-core
- [X] I have searched the existing issues, and I could not find an existing issue for this bug

### Current Behavior

Error message when running any request
```
Traceback (most recent call last):
  File "/Users/chenyuli/git/env/lib/python3.9/site-packages/jsonrpc/manager.py", line 113, in _get_responses
    result = method(*request.args, **request.kwargs)
  File "/Users/chenyuli/git/dbt-rpc/dbt_rpc/rpc/task_handler.py", line 516, in __call__
    return self.handle(kwargs)
  File "/Users/chenyuli/git/dbt-rpc/dbt_rpc/rpc/task_handler.py", line 510, in handle
    self.start()
  File "/Users/chenyuli/git/dbt-rpc/dbt_rpc/rpc/task_handler.py", line 450, in start
    self.process.start()
  File "/opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/context.py", line 284, in _Popen
    return Popen(process_obj)
  File "/opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 47, in _launch
    reduction.dump(process_obj, fp)
  File "/opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
```

### Expected Behavior

Things not failing

### Steps To Reproduce

run dbt-rpc with latest core.

I have a fix coming

### Relevant log output

_No response_

### Environment

```markdown
- OS:
- Python:
- dbt:
```


### Which database adapter are you using with dbt?

_No response_

### Additional Context

_No response_


Discussion:

Resolving patch:
diff --git a/core/dbt/task/runnable.py b/core/dbt/task/runnable.py
--- a/core/dbt/task/runnable.py
+++ b/core/dbt/task/runnable.py
@@ -68,7 +68,6 @@ def __init__(self, args, config):
         super().__init__(args, config)
         self.manifest: Optional[Manifest] = None
         self.graph: Optional[Graph] = None
-        self.adapter = get_adapter(self.config)
 
     def write_manifest(self):
         if flags.WRITE_JSON:
@@ -85,7 +84,10 @@ def load_manifest(self):
     def compile_manifest(self):
         if self.manifest is None:
             raise InternalException("compile_manifest called before manifest was loaded")
-        compiler = self.adapter.get_compiler()
+
+        # we cannot get adapter in init since it will break rpc #5579
+        adapter = get_adapter(self.config)
+        compiler = adapter.get_compiler()
         self.graph = compiler.compile(self.manifest)
 
     def _runtime_initialize(self):


Test patch: