Skip to content

fix: use tmp folder for user data dir for each concurrent chromium process#19

Merged
hengfeiyang merged 1 commit intomainfrom
multi_chrome_instance
Jun 23, 2025
Merged

fix: use tmp folder for user data dir for each concurrent chromium process#19
hengfeiyang merged 1 commit intomainfrom
multi_chrome_instance

Conversation

@Subhra264
Copy link
Collaborator

No description provided.

@Subhra264 Subhra264 requested a review from hengfeiyang June 22, 2025 16:56
@hengfeiyang hengfeiyang merged commit 055a387 into main Jun 23, 2025
3 checks passed
Subhra264 added a commit to openobserve/openobserve that referenced this pull request Jun 26, 2025
…nstances (#7322)

### **User description**
Ref: openobserve/o2_report_server#19

concurrent chromium instances tries to create singletonock file in the
`tmp/chromiumoxide-runner/SingletonLock` which throws error because only
one instance can create that at a particular time. This pr fixes this by
creating temporary user directories for chromium.


___

### **PR Type**
Bug fix, Enhancement


___

### **Description**
- Use `tempfile::tempdir` for isolated browser dirs

- Change launcher options to return builder

- Build browser config with `user_data_dir`

- Ensure tempdir cleaned up with error logging


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Bug
fix</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>report.rs</strong><dd><code>Add tempdir-based
user_data_dir and builder config</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

src/report_server/src/report.rs

<li>Switch <code>CHROME_LAUNCHER_OPTIONS</code> to
<code>BrowserConfigBuilder</code><br> <li> Modify
<code>init_chrome_launch_options</code> to return builder<br> <li>
Introduce <code>tempfile::tempdir()</code> for per-run user data<br>
<li> Build browser config with <code>user_data_dir</code> and map
errors<br> <li> Add tempdir cleanup in error and success paths


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7322/files#diff-a8d5d0e0fc56e67b38a20a46b91cc2e6bf76ade360a37ad29fce51cc4661a9a6">+24/-7</a>&nbsp;
&nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants