MCPcopy Create free account
hub / github.com/apache/cloudberry / checkQueryCancelSignal

Method checkQueryCancelSignal

gpcontrib/gpcloud/src/s3key_writer.cpp:53–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void S3KeyWriter::checkQueryCancelSignal() {
54 if (S3QueryIsAbortInProgress() && !this->uploadId.empty()) {
55 // to avoid dead-lock when other upload threads hold the lock
56 pthread_mutex_unlock(&this->mutex);
57
58 // wait for all threads to complete
59 for (size_t i = 0; i < threadList.size(); i++) {
60 pthread_join(threadList[i], NULL);
61 }
62 this->threadList.clear();
63
64 // to avoid double unlock as other parts may lock it
65 pthread_mutex_lock(&this->mutex);
66
67 S3DEBUG("Start aborting multipart uploading (uploadID: %s, %lu parts uploaded)",
68 this->uploadId.c_str(), this->etagList.size());
69 this->s3Interface->abortUpload(this->params.getS3Url(), this->uploadId);
70 S3DEBUG("Finished aborting multipart uploading (uploadID: %s)", this->uploadId.c_str());
71
72 this->etagList.clear();
73 this->uploadId.clear();
74
75 S3_DIE(S3QueryAbort, "Uploading is interrupted");
76 }
77}
78
79struct ThreadParams {
80 S3KeyWriter* keyWriter;

Callers 3

writeMethod · 0.95
flushBufferMethod · 0.95
completeKeyWritingMethod · 0.95

Calls 6

pthread_mutex_unlockFunction · 0.85
pthread_mutex_lockFunction · 0.85
clearMethod · 0.80
abortUploadMethod · 0.80
S3QueryIsAbortInProgressFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected