-
Notifications
You must be signed in to change notification settings - Fork 3
Dynamic-dim shape inference, upload conflict reporting, and libcurl lifetime #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zaoxing
wants to merge
16
commits into
main
Choose a base branch
from
fix/native-shape-and-lifecycle
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
05868f9
Infer a dynamic tensor dim in elements, not bytes
zaoxing 47adecb
Report the pack conflict that refuses to overwrite
zaoxing e2617f5
Refuse a record larger than the queue instead of waiting for room
zaoxing 139abca
Initialise libcurl once per process, not per client object
zaoxing 5832e84
Refuse a capture sink config the backend can never read
zaoxing 41313f3
Select the live CI suite by marker, not by filename
zaoxing 6eada78
Run the live suite by glob again; the tree walk imports what it canno…
zaoxing d0859c9
Fail the cpu job when a live-marked test hides outside tests/*_live.py
zaoxing e7cd00d
Pin the kBlock admission timeout natively by wedging the pipeline
zaoxing eb97cb1
Link curl_init.cpp into both extensions, with the curl flags it needs
zaoxing eca6647
Propagate a failed curl_global_init instead of latching it as success
zaoxing e036b96
Check the fixed-dimension product before inferring a dynamic dim
zaoxing bdd6e73
Make the curl-teardown source scan string-aware
zaoxing 50969e5
Revert 'Link curl_init.cpp into both extensions'
zaoxing 4734db7
Check the fixed product when no dim is dynamic, too
zaoxing 81475ed
Say what the curl source scan is not
zaoxing File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| #include "curl_init.h" | ||
|
|
||
| #include <mutex> | ||
| #include <stdexcept> | ||
| #include <string> | ||
|
|
||
| #include <curl/curl.h> | ||
|
|
||
| namespace dmi_common { | ||
|
|
||
| void EnsureCurlGlobalInit() { | ||
| static std::once_flag once; | ||
| static CURLcode status = CURLE_OK; | ||
| std::call_once(once, [] { status = curl_global_init(CURL_GLOBAL_DEFAULT); }); | ||
| // call_once only means "ran"; it says nothing about whether the init | ||
| // worked. Discarding the code turned a failed process-global init into | ||
| // misleading downstream handle/transport errors, so the failure is | ||
| // propagated to the constructing client instead. | ||
| if (status != CURLE_OK) { | ||
| throw std::runtime_error( | ||
| std::string("curl_global_init failed: ") + | ||
| curl_easy_strerror(status)); | ||
| } | ||
| } | ||
|
|
||
| } // namespace dmi_common |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // One process-lifetime libcurl initialization, shared by every client. | ||
| // | ||
| // libcurl's global init/cleanup pair is PROCESS-global and documented as | ||
| // unsafe to call while any other thread is inside the library. A client | ||
| // that initialized in its constructor and cleaned up in its destructor | ||
| // therefore tore the library down under whatever else was using it: the | ||
| // uploader runs up to `max_workers` concurrent `curl_easy_perform` calls, | ||
| // and destroying an unrelated client on the main thread dropped the | ||
| // refcount to zero beneath them — after which those workers' implicit | ||
| // re-initialization inside `curl_easy_init` raced. | ||
| // | ||
| // So: initialize once, never clean up. The OS reclaims libcurl's | ||
| // allocations at exit, which is what a process-lifetime dependency is for; | ||
| // there is no correct moment for a library-wide teardown in a process that | ||
| // still has threads. Every client calls this from its constructor rather | ||
| // than relying on the implicit init inside `curl_easy_init`, which carries | ||
| // the same thread-safety caveat. | ||
| // | ||
| // Header-level curl dependency deliberately avoided: <curl/curl.h> needs | ||
| // CURL_INCDIR on the compile line, and this declaration should be usable | ||
| // from anywhere in the tree. | ||
|
|
||
| #ifndef DMI_COMMON_CURL_INIT_H_ | ||
| #define DMI_COMMON_CURL_INIT_H_ | ||
|
|
||
| namespace dmi_common { | ||
|
|
||
| // Runs curl_global_init(CURL_GLOBAL_DEFAULT) exactly once per process. | ||
| // Safe to call from any thread, any number of times; throws std::runtime_error | ||
| // if libcurl's process-global initialization failed, so the constructing | ||
| // client does not proceed on a library that was never initialized. | ||
| void EnsureCurlGlobalInit(); | ||
|
|
||
| } // namespace dmi_common | ||
|
|
||
| #endif // DMI_COMMON_CURL_INIT_H_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.