Skip to content

fix(sekoia): add timeouts for requests (#6813)#6814

Open
axelfahy wants to merge 1 commit into
OpenCTI-Platform:masterfrom
axelfahy:fix/sekoia-timeouts
Open

fix(sekoia): add timeouts for requests (#6813)#6814
axelfahy wants to merge 1 commit into
OpenCTI-Platform:masterfrom
axelfahy:fix/sekoia-timeouts

Conversation

@axelfahy

@axelfahy axelfahy commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Proposed changes

  • Add missing timeouts for http requests.

Related issues

Checklist

  • I consider the submitted work as finished
  • I have signed my commits using GPG key.
  • I tested the code for its functionality using different use cases
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

Copilot AI review requested due to automatic review settings June 26, 2026 09:48
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
external-import/sekoia/src/connector/sekoia.py 0.00% 15 Missing ⚠️

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

❗ There is a different number of reports uploaded between BASE (1b87ee4) and HEAD (df26a67). Click for more details.

HEAD has 127 uploads less than BASE
Flag BASE (1b87ee4) HEAD (df26a67)
connectors 128 1
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #6814       +/-   ##
===========================================
- Coverage   34.80%    0.23%   -34.58%     
===========================================
  Files        2008     1916       -92     
  Lines      123164   120566     -2598     
===========================================
- Hits        42870      284    -42586     
- Misses      80294   120282    +39988     
Files with missing lines Coverage Δ
external-import/sekoia/src/connector/sekoia.py 0.00% <0.00%> (ø)

... and 1171 files with indirect coverage changes

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses connector hangs by ensuring outbound HTTP calls in the SEKOIA external-import connector use a request timeout, so the connector doesn’t block indefinitely when the upstream API stops responding.

Changes:

  • Added a timeout to the connector’s requests.get(...) calls via _send_request.
  • Introduced additional caller-side handling in some places to skip failed ID chunks / file downloads instead of stopping processing.
  • Ensured _run returns a cursor at the end (but currently with redundant conditional logic).

Comment on lines 206 to +210
self.helper.set_state({"last_cursor": cursor})
if len(items) < self.limit:
# We got the last results
return cursor
return cursor
Comment on lines 472 to +478
except RequestException as ex:
if ex.response:
error = f"Request failed with status: {ex.response.status_code}"
self.helper.connector_logger.error(error)
else:
self.helper.connector_logger.error(str(ex))
return None
raise
@romain-filigran romain-filigran added the community Contribution from the community. label Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Contribution from the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(sekoia): no timeouts for http requests

4 participants